Word.WdInformation
Have to print a monthly 1000 page txt file. Unfortunately, not all pages end with a page break, as some lines from the next page appear on the previous page.
Each page concludes with a line of asterisks. Created a Word macro, looking for the line of asterisks and if found, tested if the next line contained text from the following page. If so, an insert page break would occur.
The macro works, but now I would like to convert into vbscript.
Started my vbscript by performing the following
Opened file and then tried running the following line from my macro and it does not work
CurrentPagnr = Selection.Information(wdActiveEndPageNumber) ‘checks for current page
After looking up solutions online, someone suggested using the following library (Word.wdInformation), since I am no longer using the Word macro.
Word.wdInformation.wdActiveEndPageNumber instead of Selection.Information
Here is the new line I have tried in many variations
Set objWord = CreateObject(“Word.Application”)
CurrentPagnr = objWord.Selection.Information(Word.WdInformation.w dActiveEndPageNumber) ‘objWord is
This does not work, giving me the following error message
Microsoft VBScript runtime error: Variable is undefined: 'Word'
Any suggestions
|