ricuk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I’m very now at this and your help will be very much appreciated; I need to save an ms word document, that contains tables, as a text file and then extracted information from the text file for later use. So far I’ve managed to set up win32::ole to open word, read in the word document and save it as text. Unfortunately I then have trouble extracting the data from the text file. I now think I need to convert the table into csv before saving the document. Am I right? That’s where I’m stuck. I have built a word macro that does the conversion in the word doc. How do I write this is Perl? The macro I get is: Selection.Rows.ConvertToText Separator:=wdSeparateByCommas, NestedTables:= _ True

Replies are listed 'Best First'.
Re: Changing VB to Perl
by GrandFather (Saint) on Nov 29, 2008 at 22:35 UTC
      Thanks a lot foe your advice. I’ve now managed to get one of the vb lines changed and working: Selection.Rows.ConvertToText (is now) $word -> Selection->Rows->ConvertToText;. But I’m still struggling with: Separator:=wdSeparateByCommas, NestedTables:= _True. Can you help? What do I do with the :=?

        := denotes named arguments in Visual Basic. See Win32::OLE for how to handle named arguments with it.

        When translating from Visual Basic to Perl, it behooves you to know at least a bit about both languages. I'm confident that you can find resources for the VB syntax in your local library or even online.

Re: Changing VB to Perl
by ig (Vicar) on Nov 30, 2008 at 09:47 UTC