in reply to Re: Loop through Word Sections?
in thread Loop through Word Sections?

Thank you! I'm close. However, I'm having trouble translating a word marco command into Perl to goto the next section: after I get the count of sections, I do: for ($i=1; $i<=$sections; $i++){ #In Word, it does this next comment line, which I'm not #translating correctly and which sometimes gives the #blue screen of death... #Selection.GoTo what:=wdGoToSection, #which:=wdGoToFirst, Count:=1, Name:="" $doc->ActiveWindow->Selection->Goto ("wdGotoSection", "wdGoToNext", 1, ); #do more stuff...how in the world does above line Xlate? }

Replies are listed 'Best First'.
Re^3: Loop through Word Sections?
by Anonymous Monk on Oct 04, 2010 at 18:46 UTC

    OK, let's try formatting again... Thank you! However, I'm having trouble translating a word macro command into Perl to goto thte next section: After I get the count of sections I do:

    for ($i=1; $i<=$sections; $i++){ #In Word, it does this next comment line, which I'm not #translating c +orrectly and which sometimes gives the #blue screen of death... #Selection.GoTo what:=wdGoToSection, which:=wdGoToFirst, #Count:=1, Name:="" $doc->ActiveWindow->Selection->Goto ("wdGotoSection", "wdGoToNext", 1, + ); #do more stuff...how in the world does above line Xlate? }

      PS, the 'more stuff' is:

      $word_app->Selection->WholeStory; $word_app->Selection->Fields->Update;

      Above works on section 1 of the document only...