+ Reply to Thread
Results 1 to 6 of 6

count pages programmatically

  1. #1
    tjtjjtjt
    Guest

    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

  2. #2
    Tom Ogilvy
    Guest

    Re: count pages programmatically

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

    --
    Regards,
    Tom Ogilvy

    "tjtjjtjt" <[email protected]> wrote in message
    news:[email protected]...
    > 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




  3. #3
    tjtjjtjt
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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

    >
    >
    >


  4. #4
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    How can the number of pages be determined programimatically?

  5. #5
    tjtjjtjt
    Guest

    Re: 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
    >
    >


  6. #6
    JMB
    Guest

    Re: 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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1