#1
|
|||
|
|||
saving a mail merged document after the user edits it.
I produce a mail merge document from an Access database. The user can then further add to this document. I then want to intercept the documentclose event and prompt the user to save the file. (Note. pressing the save button alone overwrites a file.) I found the following script which I placed in the mail merge document but I now fealise that this script does not get copied over to the merged document. I placed the script in a template but it does not execute. I am now lost. Code:
Private Sub DocumentBeforeClose() On Error GoTo errorIn ActiveDocument.BuiltInDocumentProperties("Title") = InputBox("Please enter a file name (use the patient name)") Dim Today, FolderName$, NameofFile$, FullFileName$ FolderName$ = "S:\PaedCom\cardex\" NameofFile$ = ActiveDocument.BuiltInDocumentProperties("Title") FullFileName$ = FolderName$ + NameofFile$ ActiveDocument.SaveAs FileName:=FullFileName$, FileFormat:=wdFormatDocument MsgBox ("This has been saved in PAEDCOM/cardex directory under their name") Exit Sub errorIn: MsgBox ("there is an eror.") End Sub |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Saving INDV mail merges During the mail merge | sedain121 | Mail Merge | 2 | 10-04-2011 07:52 PM |
Update Document Template when Saving the Document File | bjbercaw | Word | 3 | 11-16-2010 02:03 PM |
Overlapping text once mail merged | Spartan300 | Mail Merge | 6 | 10-13-2010 06:14 PM |
Continuous page numbering in a merged document | dkeinath | Mail Merge | 0 | 07-30-2010 09:30 AM |
No toggle b/w 2 accounts; mail merged in 1 inbox | Windwardman | Outlook | 1 | 06-09-2010 09:25 AM |