Document Page Count 
Author Message
 Document Page Count

I am creating a VB application that prints ascii files through Word.  So far
I have been able to open the file in word change the document orientation to
landscape, the font name, font size and margins and then print the file.
What I am having trouble with is determining how many pages the file is. I
want to be able to tell how many pages the file is so I can decrease the
font size until I can get the entire file printed on one page.  Is this
possible?

Thanks for the help

Tim



Sun, 01 Aug 2004 17:05:07 GMT  
 Document Page Count
Hi Jack,

I think the following routine might work for your situation:

While ActiveDocument.ComputeStatistics(statistic:=wdStatisticPages) > 1
    With ActiveDocument.Content.Font
        .Size = .Size - 1
    End With
Wend

HTH

Quote:

> I am creating a VB application that prints ascii files through Word.  So
far
> I have been able to open the file in word change the document orientation
to
> landscape, the font name, font size and margins and then print the file.
> What I am having trouble with is determining how many pages the file is. I
> want to be able to tell how many pages the file is so I can decrease the
> font size until I can get the entire file printed on one page.  Is this
> possible?

> Thanks for the help

> Tim



Sun, 01 Aug 2004 21:29:57 GMT  
 Document Page Count
To get the number of pages in a document (and other data),
you can use the Information property (defined in Range
class and Selection class).

For example:

   'Assuming that doc contains a valid reference to a
   'Word Document object:

   MsgBox "The number of pages in the document is " & _
      doc.Content.Information(wdNumberOfPagesInDocument)

Stefan

Quote:
>-----Original Message-----
>I am creating a VB application that prints ascii files

through Word.  So far
Quote:
>I have been able to open the file in word change the

document orientation to
Quote:
>landscape, the font name, font size and margins and then
print the file.
>What I am having trouble with is determining how many

pages the file is. I
Quote:
>want to be able to tell how many pages the file is so I
can decrease the
>font size until I can get the entire file printed on one
page.  Is this
>possible?

>Thanks for the help

>Tim

>.



Sun, 01 Aug 2004 21:23:05 GMT  
 Document Page Count
Great!   Thanks for your help
Quote:

> I am creating a VB application that prints ascii files through Word.  So
far
> I have been able to open the file in word change the document orientation
to
> landscape, the font name, font size and margins and then print the file.
> What I am having trouble with is determining how many pages the file is. I
> want to be able to tell how many pages the file is so I can decrease the
> font size until I can get the entire file printed on one page.  Is this
> possible?

> Thanks for the help

> Tim



Mon, 02 Aug 2004 03:42:11 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How can I count pages in a document!!

2. Get a count of the number of pages in a document

3. Counting the pages in an active document

4. How to get the pages count in a document

5. Excel:Count pages & print page to printfile

6. Excel:Count pages & print page to printfile

7. Saving page breaks from Word documents to text documents

8. how to split a word document page by page

9. Break page in a RTF document (RichTextBox New Page)

10. VBD Document 1 page loaded but second page not

11. Break page in a RTF document (RichTextBox New Page)

12. Word VBA - count of specific words in document?

 

 
Powered by phpBB® Forum Software