page count, padded with leading zeroes

R

Rick

I need to get the number of pages of the active document, formatted as
3 digits with leading 0's if necessary, and converted to a string. I
believe I get the page count with this, which returns it as an
integer:

ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)

How do I get this formatted with leading 0's if necessary, converted
to a string? Thanks much for any help.
 
T

Tony Jollans

To format a number as you ask use the Format function:

Format(<number>,"000")

This will pad numbers less than 100 with leading zeroes, but will not
truncate numbers greater than 999.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top