View Single Post
 
Old 02-27-2015, 02:46 AM
JacquesW JacquesW is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Jan 2012
Posts: 21
JacquesW is on a distinguished road
Default Fieldupdate before saving and save document where documentname is resut of field values

I am a novice in macro and VBA. I know a little of macro's and I am not afraid tot experiment with VBA.

My question is:
I created a document with a number of fields in it.
There are also crosslinks to fields in the header.
When the document is closed by a user I want the following to happen:
1. Fields are updated (also the crosslinks in the header and or footer)
2. A popup appears that gives the user a choice between:
- saving as .docx or
- saving as .pdf
of course thereafter the code to execute the users choice: .docx or .pdf.

When executing that code I want the documentname pre filled as a result of a prefix plus the date plus the values that the user has filled in in three fields.

sometjhing like this:
VBP [yyyymmdd] [value field 1] [value field 2] [value field 3].docx or .pdf
"VBP 20150226 Surname 00045678 salary.docx"

The user then only can choose the location where to save the document.

I know for a novice I am asking a lot at once.
At the same tine I do not know if this is best done in VBA or with a macro?

I hope someone can help me.
Reply With Quote