Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-08-2015, 09:34 AM
drussell drussell is offline Word.WdInformation Windows 7 32bit Word.WdInformation Office 2010 32bit
Novice
Word.WdInformation
 
Join Date: Dec 2015
Posts: 3
drussell is on a distinguished road
Default 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
Reply With Quote
 



Other Forums: Access Forums

All times are GMT -7. The time now is 11:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft