From markjaskilka at netscape.net Fri Oct 8 20:21:38 2010 From: markjaskilka at netscape.net (markjaskilka at netscape.net) Date: Fri, 08 Oct 2010 23:21:38 -0400 Subject: [Pikes-peak-pm] Word OLE Question Message-ID: <8CD35783824EDB3-1FD4-10CBF@Webmail-d125.sysops.aol.com> Hello! Has anyone bumped into this before? I have a Perl script that basically does what I want it to do which is to seek the current page header, select all, then do an update, which updates the display in the header of the document to display the value of a DocProperty field. That part of the code looks like this: $word_app->ActiveWindow->ActivePane->View->{Type} = wdPrintView; $word_app->ActiveWindow->ActivePane->View->{SeekView} = wdSeekCurrentPageHeader; $word_app->Selection->WholeStory; $word_app->Selection->Field->Update; Now, the problem is that many Word Documents have more than one Section, so I?m now trying to loop this to go through and update every section. The above code only updates the first section of the document so? now I?m doing: My $sections = $doc->Sections->Count(); $word_app->ActiveWindow->ActivePane->View->{Type} = wdPrintView; For ($i=1; $i<=$sections; $i++){ #Macro to translate: Selection.GoTo What:=wdGoToSection, which:=wdGoToNext, Count:=1, Name:=?? #Next line is an attempt to translate but it is NOT working $word_app->ActiveWindow->Selection->GoTo(?wdGoToSection?, ?wdGoToNext?, 1, 0); $word_app->ActiveWindow->ActivePane->View->{SeekView} = wdSeekCurrentPageHeader; $word_app->Selection->WholeStory; $word_app->Selection->Field->Update; } Do you have any ideas that would help me out?? Thanks so much! Mark = -------------- next part -------------- An HTML attachment was scrubbed... URL: