ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   count pages programmatically (https://www.excelbanter.com/excel-programming/333665-count-pages-programmatically.html)

tjtjjtjt

count pages programmatically
 
I've just discovered my 'new' work computer doesn't have VB Help installed...
I'm trying to:

Print out a document periodically that will be a variable number of pages
tall. Sometimes, it will also be (barely) more than one page wide.
Is there a way to count the number of horizontal pages or the hpagebreaks,
so I can set the FitToPagesTall appropriately while setting FitToPagesWide =
1?
--
tj

Tom Ogilvy

count pages programmatically
 
Leave pages tall blank ( set it to "") Just set pages wide.

--
Regards,
Tom Ogilvy

"tjtjjtjt" wrote in message
...
I've just discovered my 'new' work computer doesn't have VB Help

installed...
I'm trying to:

Print out a document periodically that will be a variable number of pages
tall. Sometimes, it will also be (barely) more than one page wide.
Is there a way to count the number of horizontal pages or the hpagebreaks,
so I can set the FitToPagesTall appropriately while setting FitToPagesWide

=
1?
--
tj




tjtjjtjt

count pages programmatically
 
Thanks, Tom. It seems I had a typo I missed. When I retyped it, I was able to
get the count--your way is, of course, better.
So, now I've got this:
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False

--
tj


"Tom Ogilvy" wrote:

Leave pages tall blank ( set it to "") Just set pages wide.

--
Regards,
Tom Ogilvy

"tjtjjtjt" wrote in message
...
I've just discovered my 'new' work computer doesn't have VB Help

installed...
I'm trying to:

Print out a document periodically that will be a variable number of pages
tall. Sometimes, it will also be (barely) more than one page wide.
Is there a way to count the number of horizontal pages or the hpagebreaks,
so I can set the FitToPagesTall appropriately while setting FitToPagesWide

=
1?
--
tj





bhofsetz[_103_]

count pages programmatically
 

How can the number of pages be determined programimatically?


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=384659


tjtjjtjt

count pages programmatically
 
I needed the number of horizontal pages. Before Tom showed me a simpler
solution that fit my needs, I was using this code in a longer routine to find
the number of horizontal pages:

ActiveSheet.HPageBreaks.Count + 1


--
tj


"bhofsetz" wrote:


How can the number of pages be determined programimatically?


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=384659



JMB

count pages programmatically
 
From: http://j-walk.com/ss/excel/tips/tip65.htm

PageCount = ExecuteExcel4Macro("Get.Document(50)")


"bhofsetz" wrote:


How can the number of pages be determined programimatically?


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=384659




All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com