PDA

View Full Version : Solved: Having date "saved" appear in footing



Jimbo
09-05-2005, 02:39 PM
I'm very new to VBA for word and a little familiar with VBA for Excel. I need the "See Spot run" type of explaination. I would like to have the date and time appear in the footing of my Word document when I save any changes that I may make to the document. That will facillitate knowing which printed copy of the document is the latest and greatest. Thank you for any help you may give.
Jim :banghead:

MOS MASTER
09-05-2005, 03:43 PM
Hi & Welcome to VBAX Jim! http://vbaexpress.com/forum/images/smilies/039.gif

Of course there's a method to do this with VBA but there is a very simple method to do this with buildin tools by Word that work reliable too.

Let's first try out that option and tell me later if that works yes or no. (And why not if no)

We'll be using a Autotext entry in the document footer to show the date and time of the last print..ready?:

Open your Word document
Go to View | Header & Footer
Press the fourth button (Switch between Header & Footer) from the right on the Header & Footer toolbar
Now you should be in the Footer of your document
Press the dropdown "Insert Autotext" on the toolbar to expand it.
Choose "Last Printed" from the list.
Now you have something like: "Last printed: 06-09-2005 0:33" in your footer (Or all zero's if the document has never been printed before)

Press the close button on the toolbar to leave the Header Footer view and Save your document.

Now press the printbutton and you'll see that the field in your Footer is updated to the time you pressed the button.

We could add a little macro to save the document if someone pressess the Print button to have a "Point in Time" Save of that event. (Not needed in my opinion but I don't know what your needs are)

I'd say have a go with it and tell me if it suiths your neads?

HTH, http://vbaexpress.com/forum/images/smilies/whistle.gif

TonyJollans
09-05-2005, 03:49 PM
Hi Jimbo,

Welcome to VBAX!

You don't need any VBA for this.

When editing your Footer, select Insert > Field from the Menu
Under Categories select Date and Time (it depends on your version whether this is a listbox or a dropdown)
Under Field Names, select SaveDate
Click on Options and choose the format you want
OK out of it and you will have what you want.

Be aware thatFields are not automatically updated but there is an option under Tools > Options > Print tab to have them automatically updated before printing (the Update Fields checkbox).

TonyJollans
09-05-2005, 03:52 PM
I knew I should have pressed Refresh before posting :)

MOS MASTER
09-05-2005, 03:56 PM
I knew I should have pressed Refresh before posting :)

Hi Tony, :hi:

Well it's fun we both have the same kind of sollution only Mine gives the last printdate and yours gives the last save date so Jim is the winner getting to choose the one he likes best! :whistle:

MOS MASTER
09-05-2005, 03:59 PM
Be aware thatFields are not automatically updated but there is an option under Tools > Options > Print tab to have them automatically updated before printing (the Update Fields checkbox).

Very good tip Tony! :yes

Always sensible when using fields. But FYI the method I use doesn't need this cause it's using a special field that Word will update on print if that option is on or not!

Later my knowledgable friend! :whistle:

Jimbo
09-05-2005, 07:41 PM
Tony & Joost,
Thank you for your help. I tried both ideas and they both work but Tony's method gives me the results that I need which is a "version" number. If the date changes when printed then I will have sheets with the same info with differing "version" dates. If I use Tony's method then no matter when I print the "version" remains the same untill I save a change in the document which then gives the new date. Again I thank you both very much.:bow:

MOS MASTER
09-06-2005, 10:30 AM
Hi Jim, :hi:

Glad we could help you! :beerchug: