Word.Tips.Net Welcome toWord.Tips.Net

Helpful Links

Tips.Net Home
WordTips Home

Ask a Word Question
Make a Comment

Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

Newest Tips

Printing On Both Sides of the Paper

Turning Off AutoComplete for Dates

Ordering Search and Replace

Understanding Auto Line Spacing

Adding Comments to Your Document

Conditional Calculations in Word

Determining Word Frequency

 

Determining the Current Page Number with WordBasic

Summary: How to figure out, in a WordBasic macro, the page number where the selection pointer is located. (This tip works with Microsoft Word 6, and Word 95.)

As you are programming your macros, you may have a need to know the current page number on which the insertion point is located. This is easily obtained by using the following code line in your WordBasic macro:

CurPage = SelInfo(1)

When executed, CurPage is set to the value that would print if you asked Word to print a page number. CurPage represents a logical page number, not a physical page number. The difference is that logical page numbers take into account manual adjustments that may have been made to the document. For instance, if the user instructed Word to start counting pages at some value other than 1.

Tip #727 applies to Microsoft Word versions: 6 | 95

Step Up and Take Control! Subscribers to WordTips know just how valuable a resource it is. WordTips Premium provides twice the number of exceptional, easy-to-understand tips every week in an ad-free newsletter, as well as substantial discounts on WordTips archives and e-books.
 
Check out WordTips Premium today!