Q
quartz
I am automating Word from Excel and I need a sure fire method for selecting
ONE entire page. I have developed the following function, but this sometimes
picks up (or adds) an extra return or two that puts the selection over ONE
page.
Could someone please correct this function so that only ONE page is
selected, or otherwise give me a clue as to what is going on?
Public Function WordSelectPage(argAppRef As Object, argFileName As String,
argPageNumber As Long)
'SELECT A SPECIFIC PAGE IN A WORD DOCUMENT;
argAppRef.Documents(argFileName).Activate
argAppRef.Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext,
Name:=argPageNumber
argAppRef.ActiveDocument.Bookmarks("\Page").Range.Select
End Function
Thanks much in advance.
ONE entire page. I have developed the following function, but this sometimes
picks up (or adds) an extra return or two that puts the selection over ONE
page.
Could someone please correct this function so that only ONE page is
selected, or otherwise give me a clue as to what is going on?
Public Function WordSelectPage(argAppRef As Object, argFileName As String,
argPageNumber As Long)
'SELECT A SPECIFIC PAGE IN A WORD DOCUMENT;
argAppRef.Documents(argFileName).Activate
argAppRef.Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext,
Name:=argPageNumber
argAppRef.ActiveDocument.Bookmarks("\Page").Range.Select
End Function
Thanks much in advance.