P
pk
Hello again. FYI - I am automating Word from Excel.
I have the following function that is supposed to select a
specific page in a document, it works well, unless the
target page is the LAST page in the document:
Dim wrdApp As Word.Application
Set wrdApp = GetObject(, "Word.Application")
wrdApp.Documents(argFileName).Activate
With wrdApp.Selection
.ExtendMode = False
.GoTo What:=wdGoToPage, Which:=wdGoToNext,
Name:=argPageNumber
.ExtendMode = True
.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1 ',
Name:=""
.ExtendMode = False
End With
Can someone tell me what is wrong or how I can always
concisely select an entire page no matter where it is in
the document? Your example code is most appreciated.
Thanks much in advance.
I have the following function that is supposed to select a
specific page in a document, it works well, unless the
target page is the LAST page in the document:
Dim wrdApp As Word.Application
Set wrdApp = GetObject(, "Word.Application")
wrdApp.Documents(argFileName).Activate
With wrdApp.Selection
.ExtendMode = False
.GoTo What:=wdGoToPage, Which:=wdGoToNext,
Name:=argPageNumber
.ExtendMode = True
.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1 ',
Name:=""
.ExtendMode = False
End With
Can someone tell me what is wrong or how I can always
concisely select an entire page no matter where it is in
the document? Your example code is most appreciated.
Thanks much in advance.