C
clueless
Hello, please help if you are able. I am using VBA in Excel XP with Windows 2K to automate Word XP
I have a program that automates several Word documents from Excel. They all work fine, except one Word document. My code opens the Word document and then it is supposed to activate a specific page. The problem is, the document always stays on page one no matter which page the program tries to activate
I can not find any formatting in the problem document that is any different from any of the other documents I'm automating successfully. It consists of 3 pages in one section with paging beginning at 3. I even tried putting in hard page breaks, but it still refuses to activate any page other than page 1. Can someone think of a reason why this problem would occur
FYI, my code follows if you need it
'*****************************************
Dim strFileName As Strin
Dim wrdApp As Word.Applicatio
'Create an object reference to the running instance of Wor
Set wrdApp = CreateObject("Word.Application"
'Open the file read onl
wrdApp.Application.Documents.Open
strFullSourceFileName,
False,
True,
False,
"",
"",
Fals
'Ensure opened file is visible and activate i
wrdApp.Visible = Tru
wrdApp.Activat
'Go to the page desire
wrdApp.Selection.Goto What:=wdGoToPage, Name:=intSourcePage '< my variable that should activate page
**************************************
TIA for your assistance
I have a program that automates several Word documents from Excel. They all work fine, except one Word document. My code opens the Word document and then it is supposed to activate a specific page. The problem is, the document always stays on page one no matter which page the program tries to activate
I can not find any formatting in the problem document that is any different from any of the other documents I'm automating successfully. It consists of 3 pages in one section with paging beginning at 3. I even tried putting in hard page breaks, but it still refuses to activate any page other than page 1. Can someone think of a reason why this problem would occur
FYI, my code follows if you need it
'*****************************************
Dim strFileName As Strin
Dim wrdApp As Word.Applicatio
'Create an object reference to the running instance of Wor
Set wrdApp = CreateObject("Word.Application"
'Open the file read onl
wrdApp.Application.Documents.Open
strFullSourceFileName,
False,
True,
False,
"",
"",
Fals
'Ensure opened file is visible and activate i
wrdApp.Visible = Tru
wrdApp.Activat
'Go to the page desire
wrdApp.Selection.Goto What:=wdGoToPage, Name:=intSourcePage '< my variable that should activate page
**************************************
TIA for your assistance