bottom
Great WordTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > WordTips Home > Macros > WordBasic Examples > Determining the Current Page Number with WordBasic

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


More Power! For some people, the prospect of creating Word macros can be scary. WordTips: The Macros can help you conquer your fears and you'll discover you're much more confident and productive as you make Word do exactly what you want. This is an invaluable source for learning macros. You are introduced to the topic in bite-sized chunks, pulled from past issues of WordTips. Learn at your own pace, exactly the way you want.
 
Check out WordTips: The Macros today!

Helpful Links

Ask a Word Question
Make a Comment

Tips.Net Home
Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

 

Great Info!

Get tips like this every week in WordTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)