Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2011, 03:35 AM
kosh2 kosh2 is offline saving a mail merged document after the user edits it. Windows 7 32bit saving a mail merged document after the user edits it. Office XP
Novice
saving a mail merged document after the user edits it.
 
Join Date: Aug 2011
Posts: 1
kosh2 is on a distinguished road
Default 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
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
saving a mail merged document after the user edits it. 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
saving a mail merged document after the user edits it. 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
saving a mail merged document after the user edits it. No toggle b/w 2 accounts; mail merged in 1 inbox Windwardman Outlook 1 06-09-2010 09:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:41 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft