Try changing "Fields->{Update}" 
to
"Fields->{update}"
or
"Fields->update()"

        -----Original Message----- 
        From: Ilaiy [mailto:[EMAIL PROTECTED] 
        Sent: Sat 6/12/2004 2:39 PM 
        To: [EMAIL PROTECTED] 
        Cc: 
        Subject: Microsoft Word and Perl 
        
        

        I have been trying to update my word document using perl, i used
        
        $word->Selection->WholeStory;
        $word->Selection->Fields->{Update};
        
        
        But this is a little slow and at times doesnot update completely. I
        modified the code and right now getting a wired error but the same in
        VBA works really well .
        
        
        my $newdoc = $word->ActiveDocument;
        foreach my $obj_Story ($newdoc->StoryRanges ){
         $obj_Story->Fields->{Update};   ==> Cannot find object
         while ($obj_Story->NextStoryrange != ""){
          $obj_Story = $obj_Story->NextStoryRange;
          $obj_Story->Fields->{Update};    ==> Cannot find object
         }
        }
        
        
        The equivalent in VBA is ..
        
            Dim obj_Story As Range
            For Each obj_Story In ActiveDocument.StoryRanges
                obj_Story.Fields.update
                While Not (obj_Story.NextStoryRange Is Nothing)
                    Set obj_Story = obj_Story.NextStoryRange
                        obj_Story.Fields.update
                Wend
            Next obj_Story
                Set obj_Story = Nothing
        
        
        
        Could someone tell me where am i going on.
        
        
        Ilaiy
        
        
        
        --
        To unsubscribe, e-mail: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        <http://learn.perl.org/> <http://learn.perl.org/first-response>
        
        
        

Reply via email to