MaryS
2009-07-13 21:16:01 UTC
I have an Excel script that opens Word, selects some number of lines of text,
cuts the selection, then pastes the information into Excel where the data is
further manipulated.
Instead of selecting lines of text, I would like to change the code to
select pages of text (i.e. the first 100 pages). I found the following code
in another posting in this forum.
Dim rgePages As Range
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=2
Set rgePages = Selection.Range
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=4
rgePages.End = Selection.Bookmarks("\Page").Range.End
rgePages.Select
It works great when I run it as a Word script, but I run into trouble when I
bring it into the Excel script. How can I select pages 1-100 in a Word
document from my Excel script?
I'm using VB 6.5. Any suggestions would be appreciated.
cuts the selection, then pastes the information into Excel where the data is
further manipulated.
Instead of selecting lines of text, I would like to change the code to
select pages of text (i.e. the first 100 pages). I found the following code
in another posting in this forum.
Dim rgePages As Range
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=2
Set rgePages = Selection.Range
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=4
rgePages.End = Selection.Bookmarks("\Page").Range.End
rgePages.Select
It works great when I run it as a Word script, but I run into trouble when I
bring it into the Excel script. How can I select pages 1-100 in a Word
document from my Excel script?
I'm using VB 6.5. Any suggestions would be appreciated.