Letter template option

AdamO

Registered User.
Local time
Today, 14:44
Joined
Jun 26, 2002
Messages
40
I am looking for some guidance on how I can approach a new requirement.

We have nine standard letters which could be used for clients. From a form containing the customer name and address details, I am would like a kind of selection box which users can select the template they require, add a few additional details to be inserted into the letter, such as date and then produce the letter.

I have this working for a single letter which is then produced as a Access report. I would prefer not to have 10 command buttons; I guess I need a combo which could then after selection ask for the additional details.

The above assumes the letters are produced as Access reports. However, some will need to use Word and have data merged into Word. I have tracked another post which indicates how this can be done for a single merge (bookmarks etc).

I am not very experienced in Access and would like someone to point me in the right direction in terms of the above or identify any other approaches which may have worked for them.

As much info as possible would be appreciated.

Thank you.
 
I have a form with a list box called DocName. The relvant document is selected in here and the routine below uses a mailmerge to create the letter. Note that I have separate directories set up for each user so that there are no naming conflicts. The path is held as Workfolder. The master documents are held in a folder called DocMaster.

I'm sure there are many clumsy elements of my code (especially the empty directory fudge!) but it works for me!

'Check for document selected
If IsNull(DocName.Column(2, DocName.ItemsSelected)) Then
MsgBox "No contract selected"
GoTo Exit_Writelet_Click:
End If
'Create variables for document name and document path
Docpath = DocName.Column(2, DocName.ItemsSelected)
Doctitle = DocName.Column(1, DocName.ItemsSelected)
'MsgBox Docpath
'Empty workfolder, copy template and source file to workfolder
FileCopy (ParentDir & "dummy.txt"), (WorkFolder & "dummy.txt")
Kill (WorkFolder & "*.*")
FileCopy (ParentDir & "DocMaster\" & Docpath), (WorkFolder & Docpath)
'FileCopy (ParentDir & "Docmaster\mergedata.doc"), (WorkFolder & "mergedata.doc")
'Create mailmerge file
Datafile = WorkFolder & "mergedata.doc"
'MsgBox Datafile
DoCmd.OpenQuery "Letcontract", acNormal, acReadOnly
DoCmd.TransferText acExportMerge, "", "Letcontract", Datafile, False, ""
DoCmd.close acQuery, "Letcontract"
'Open word and load file
Dim objword As Word.Application
Set objword = New Word.Application
objword.Visible = True
objword.Activate
objword.Documents.Open (WorkFolder & Docpath)
 

Users who are viewing this thread

Back
Top Bottom