Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Australia
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding to Footer (VBA/Word/97+)

    A user normally creates a document from a template with a userform. A bookmarked table is populated with the responses of that userform and this is passed into the header. The document may then be printed or converted to an electronic version (pdf).

    What I am attempting to do is to programatically place a 'Print date' in a footer but ONLY for the printed version. The electronic copy should not show this print date.

    I realise the limitation of trying to place a bookmark in the footer and having a userform update it so I don't think it can be done that way.

    Any suggestions please?

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Adding to Footer (VBA/Word/97+)

    I think the way you will need to address this is by using a macro to hijack the print command (FilePrint).

    The macro will have to perform the following steps
    1. Add the date to the footer
    2. Print the file
    3. Remove the date from the footer

    The complication is that Acrobat files are produced by way of a print command too to the macro will have to include working out which printer is being used to make sure the date is not added when the AcrobatDistiller or PDFWriter print drivers are being used.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    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: Adding to Footer (VBA/Word/97+)

    Is the idea not to have any user intervention? If the user can be prompted with a simple message box that says "Show the date?" you could do this:

    Add a DATE field to the footer, bookmark it, and then select it and make it hidden text (CTrl+H or Format>Font>Hidden).

    Create a print macro that asks the question and, if the user wants to show the date, selects the bookmark, unhides the selection, prints, and then reselects the bookmark and hides the selected text.

    Does that sound okay? (I am assuming that the Acrobat converter ignores hidden text. I actually don't know if that is true.)

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Adding to Footer (VBA/Word/97+)

    It would seem more natural to use a { PRINTDATE } field than a { DATE } field. Although I think it would give the same effective result.

    The option to Print hidden data is separate to the one to show it on screen. If you could persuade your users to configure word so that hidden data is printed but not shown on screen they you could do this with no Macro at all.

    StuartR

  5. #5
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding to Footer (VBA/Word/97+)

    Does the PDFMaker call the FilePrint command? If not, you could intercept that, and before printing, put a PRINTDATE field in the footer.

    Alternately, you could put the field in the footer by hand, as in something like: { IF {DOCVARIABLE printing} True {PRINTDATE}}, and then have the FilePrint intercept change the document variable "printing" to True. Just a thought.

  6. #6
    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: Adding to Footer (VBA/Word/97+)

    I can't remember whether we had a thread on this, but does Word update the PRINTDATE before or after it prints?

    (And if "Timeslides" means anything to anyone, you know what DVD I just bought.)

  7. #7
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Adding to Footer (VBA/Word/97+)

    It took a fairly simple experiment to confirm that { PRINTDATE } is updated before printing.

    StuartR

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Australia
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding to Footer (VBA/Word/97+)

    Firstly, many thanks for the responses. This is the first chance I have had to respond and read any of the replies. I was without Internet access since Sat (24th July) due to a cable problem that has just been repaired (technician's finding - the fly-lead signal strength had deteriorated and the new cable modem would not operate at all) plus I had to go to Cairns until last Wednesday night (28th) ( - tough life, but someone had to do it!).

    I will explore all options offered and respond later this weekend after I catch up with work as I am sure that someone else would want this 'feature' at some time as more organisations move towards documents being available on the internal intranet but also required to be printed with a date stamp.

    Thanks again everone - although there was no offering from HansV - not that I am complaining; he just seem to have an broad interest in everything! <g>

  9. #9
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Australia
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding to Footer (VBA/Word/97+)

    I am still to get back to this project but to answer your question -
    Yes, my version of a PDF convertor (CutePDF Writer) does ignore hidden text.

Posting Permissions

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