in reply to How do I Selecting All in a MSWord doc?

You might want to check out the review of Win32::OLE for one way to get all the text of a Word document.

Update: By the way, you should look at an MS Word macro that selects all the text... you will find that it doesn't use SelectAll().

  • Comment on Re: How do I Selecting All in a MSWord doc?

Replies are listed 'Best First'.
Re: Re: How do I Selecting All in a MSWord doc?
by LameNerd (Hermit) on Jan 24, 2003 at 23:40 UTC
    Hi Mr. Mushrat,
    Don't tell me I can only select text! I want to be able to get everything.
    You know, drawings, formating, comments, table of contents, all that stuff.
    Can it be done in Perl?
      I'm sure that it can. I read your question as "how do I select all of the text" instead of "how do I select everything". Create yourself an MS Word macro that selects everything in an MS Word doc and then view the code of the macro. It will give you the information you seek.
        great Idea!
        Here's what I got:
        Sub LN_Select_all()
        '
        ' LN_Select_all Macro
        ' Macro recorded 1/24/03 by LameNerd
        '
            Selection.WholeStory
            Selection.Copy
        End Sub
        
        This tells me that I should change my Perl code from:
        my $select1=$WordDoc1->SelectAll() or die "Could not do SelectAll() on doc1\n"; $select1->Copy();
        to:
        my $select1=$WordDoc1->WholeStory() or die "Could not do WholeStory() on doc1\n"; $select1->Copy();
        right?