Results 1 to 13 of 13
  1. #1
    New Lounger
    Join Date
    Feb 2001
    Location
    St-Hubert, Qu, Quebec, Canada
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing problems with headers

    Hi everyone,
    I'm really in a bind and thinking of opening a ticket with MS tomorrow, but
    decide to check with you guys at the same time.
    Not that I don't expect them to figure it out!?!?

    Thanks for reading me.
    ===============--------------------------------------------===============
    I have an application which create documents compose of many sections. Each
    sections have different headers. The building of the document is done
    through a macro. I'm using MSOffice 2000.

    I also have a macro that takes care of printing these documents in part.
    i.e. Main part, which might be anywhere from 1 to x sections, then other
    part(s) that are compose of 1 to x sections. All of these parts are printed
    as separate documents, as the content goes to different customers. The print
    macros figures how to print by using information store in the document's
    custom properties that were stored at creation time.

    My problem is an intermittent one. Where for some documents the headers
    don't print correctly. i.e. Using the a header and applying it to all
    subsequent sections of the print document for no apparent reason.

    >>>> The online document is fine. <<<<

    To print, the document defines a range (to print), selects it, save the
    document in a slightly different name (the name as to be different for each
    part) and then use the ".PrintOut Range:=wdPrintSelection" to print.

    I've also tried printing with ".PrintOut Range:=wdPrintFromTo,
    From:=ls_FromPage, To:=ls_ToPage", but it didn't work as only the first part
    (output job) contains all the pages of the document (not only the selection
    to print but the whole document) and all subsequent output parts have less
    than 20 bytes (like pointers) which is not working at all for me.

    As anyone encountered this problem? Does anyone have suggestions? I could
    send the print macro and a document that is problematic if requested (about
    160KB).

    Thanks again.

    Jacques Lamarche

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Printing problems with headers

    Hi Jacques,

    It sounds like this is a pretty ambitious macro.
    One thing I'm unclear of from your description: are you trying to create and save as separate documents, all the different parts of the original document (as well as print out all of the parts), or are you just trying to print out separate parts of one document?
    - the two different scenarios would require different approaches.

    I've found that controlling the effects of section breaks, via VBA, to be baffling at times. Actions involving section breaks that would seem to be sensible if done within the user interface, seem to act differently when done in VBA. Sometimes a lot of trial and error is required before you stumble onto the right combination.

    You should experiment with extending or reducing your selection range, to include or exclude section breaks that may be causing trouble. In particular, the section break at the end of a section should be controlling that section's layout characteristics, so you might experiment with making the section break at the end of the selection, part of the selection range before printing.

    Hope this helps,
    Gary

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    352
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Printing problems with headers

    I wonder if the problem is to do with the documents not getting formatted for different printers until they are opened. The macro might need to open all the documents so that appropriate relativities are established before it sets them up for printing on the particular printer.
    David Grugeon
    Brisbane Australia

  4. #4
    New Lounger
    Join Date
    Feb 2001
    Location
    St-Hubert, Qu, Quebec, Canada
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing problems with headers

    The only reason that the document is save, with the selection to print "selected", under a different name is that the printer that receives the job needs different name for each print job.

    The print macro is complex for somebody that doesn't know Word and objects, that much, but it works in most cases. The users print something like an average of 30 documents that ends up to about 90 print jobs per day. In the last year and a half this as happen only in 3 cases that the customers notice! It might have happen more often, but the users don't see the printed result, only the electronic version of the full document.

    I guess that when you say "experiment with extending or reducing your selection range" you means something like 1 char. up or down from the actual selection!?! But I have documents as big a 250 pages that ends in about 50 print jobs that worked fine with the same code (to build and print!).
    In the document where the problem exist... One of the print jobs has 3 sections with different headers, but the job print with the header of the first section for all three sections (all the Footers are fines). The problems is really the headers....

    Thanks

  5. #5
    New Lounger
    Join Date
    Feb 2001
    Location
    St-Hubert, Qu, Quebec, Canada
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing problems with headers

    I have tried with two different printer and both ends with the same result. One is a HP Laser jet (test) and the production one, is a Postcript Xerox that is use for big and I mean really big output...

    Thanks.

  6. #6
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Tallahassee, Florida, USA
    Posts
    901
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing problems with headers

    >>I have an application which create documents compose of many sections.

    Is this a third-party add-in? If so, you may want to contact the creator of the application and not Microsoft.

    >>I'm using MSOffice 2000.

    You don't indicate if there's a service release. SR1a (not SP2) fixes some issues with erroneous printing of page numbers, [img]/w3timages/icons/thinks.gif[/img]...and maybe your header issue too, although I haven't seen that specifically mentioned anywhere. Again, if you have a 3rd party app running, it may not do well with the service release (but it should not affect it). Check with it's creator first.

    >>Using the a header and applying it to all subsequent sections of the print document for no apparent reason

    I may be misunderstanding what your macro is doing with the copying to separate document for print, but... it probably has to do with how routines go about creating the secondary documents and which section breaks it includes or doesn't include. As Gary indicated, they are very tricky to manage in VBA.

    Good luck!
    Karen

  7. #7
    New Lounger
    Join Date
    Feb 2001
    Location
    St-Hubert, Qu, Quebec, Canada
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing problems with headers

    Always forget some detail when posting!
    I'm running SR-1 and it's not a third party. All macros when written by me and a colleague.

  8. #8
    New Lounger
    Join Date
    Feb 2001
    Location
    St-Hubert, Qu, Quebec, Canada
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing problems with headers

    Just to thank you all for your input. With some of the comments and by reading a little bit more on microsoft site, I have found what the problem is... The selection doesn't use the last header when printing. I actually found that cut and paste reacts the same. Section information is a mess!!!
    Now the solution is not that easy, as I have spent most of the day to resolve it and only works in 1/3 of the time. The problem is in finding which paragraph marks contain the information that I need before deleting what I don't want to print!!!

    Thanks again.

  9. #9
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Printing problems with headers

    Hi,

    I just stumbled across the following KB Article which describes something similar to what you're trying to do.

    The method though is a little different, using Word's built-in section bookmark ("Section") to distinguish the separate sections - might be worth a try.

    Gary

  10. #10
    New Lounger
    Join Date
    Feb 2001
    Location
    St-Hubert, Qu, Quebec, Canada
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing problems with headers

    Found how to solve my problem!!![img]/w3timages/icons/clever.gif[/img]
    HISTORY
    My original document is build by section and most section(s) have their own header (not link). When a new section break is inserted, I remove the link for the header. Then the newly created section's header is deleted and rebuild according to the new spec. The end result is a document of many sections where some are linked and some aren't and where some part starts at page 1...
    SYMPTOMS
    Now, my problem was, when I was printing from section(a) to section(d) the header of section(d) was being replace by the header of sectionę. Printing was done by defining a range containing the sections to print and using the "Printout selection" command to print different part in separate jobs.
    SOLUTION
    I found with experimentations, that if I inserted a new section break (next page) before the existing section(e) - the section right after the part that needed to be print, I could now use the "Printout Frompage/Topage" command, and only the pages that I needed was print and all headers are now fine.

    Boy these sections are really tricky. The problem would never have happen if my document parts where all save as different documents. That would not be practical for the users, unless they use something like the office binder. This is only part of a document management/publishing system...

    Also this macro is used in a daily batch process, so there's no issue with users printing the document in part.

    Again, thanks to all your great input.
    Jacques L.

  11. #11
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing problems with headers

    Jacques: I'm having the EXACT same problem. However, I'm not deleting any sections, per se. What I'm doing is printing a series of court documents, i.e., complaint, Exhibit, Summons, Letter to the Client. The complaint and Summons have line numbers in the left margin (they are inserted as a header). I'm fine unless I decide NOT to print the Letter to the client (Conditional section here). THEN, my summons, winds up with NO line numbers becasue it is taking on the formatting of the section before it (Exhibit) which has no line numbers. I've beaten my head against this for days.... The print macro I'm using looks for bookmarks, selects the print between the bookmarks and then prints (and sometimes staples), then moves to the next bookmarked section.
    Hope this isn't too confusing....
    <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>

  12. #12
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Printing problems with headers

    Is the problem that your macro uses Print Selection rather than printing a range of pages? If so, I posted some code a while back that prints the entire pages for whatever might be selected (<post#=204230>post 204230</post#> - Sub PrintSelectedPageRange()). Maybe that will help?

  13. #13
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing problems with headers

    Thanks. I will check this out

Posting Permissions

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