Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

Selection.Information

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brad - 05 Jan 2005 18:42 GMT
Hi,

I am using the following to get the number of pages there
are in a Word document (from within Excel). I can also use
it directly in Word without the "appWrd ".

Dim EndPage as Integer
EndPage = appWrd.Selection.Information
(wdNumberOfPagesInDocument)

This works sometimes, but the other times I get the error
message "Run Time Error 91 Object Variable or With Block
Variable not Set".

Is there something additional I need to do so I do not get
this error? I do not understand why it works sometimes but
not all the times.

THANKS!
Greg - 05 Jan 2005 19:30 GMT
Brad,

Maybe a variation of:

Dim EndPage As Long
EndPage = ActiveDocument.ComputeStatistics(wdStatisticPages)
would work better.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.