mistercormell
Registered User.
- Local time
- Today, 08:24
- Joined
- Feb 20, 2007
- Messages
- 15
I have created a variety of mail merged documents that are opened by a visual basic procedure using VBA from within my database system. e.g. the document is selected in Access from a drop down box in a dialogue box. The 'OK' button is clicked and visual basic loads up the document selected, my code is below:
Option Compare Database
Dim objWord As Word.Application
Private Sub cmdGOletter_Click()
Forms!frmLetter.cmbLetter.SetFocus
Set objWord = CreateObject("word.Application")
objWord.Visible = True
Select Case cmbLetter.Text
Case "Clients"
objWord.Documents.Open "d:\computing project\Letters\Clients.doc", , , False
Case "Funders"
objWord.Documents.Open "d:\computing project\Letters\Funders.doc", , , False
Case "Volunteers and Staff"
objWord.Documents.Open "d:\computing project\Letters\Workers.doc", , , False
Case "Everybody"
objWord.Documents.Open "d:\computing project\Letters\Everybody.doc", , , False
End Select
End Sub
**This code loads the correct document fine, but however disables the mail merge top toolbar on load - something that does not happen when the document that is being opened is opened directly from file.
It is important that my user can navigate between the records of the mail merged document otherwise they will only ever be able to do a personalised letter for the first person in the list!
Read only is not an issue as I have tried it with and without. at the moment I have set them to edit protection, so that the user can open in read only to print off, and a technical analyst can use the password to alter it.
Any help would be appreciated
Option Compare Database
Dim objWord As Word.Application
Private Sub cmdGOletter_Click()
Forms!frmLetter.cmbLetter.SetFocus
Set objWord = CreateObject("word.Application")
objWord.Visible = True
Select Case cmbLetter.Text
Case "Clients"
objWord.Documents.Open "d:\computing project\Letters\Clients.doc", , , False
Case "Funders"
objWord.Documents.Open "d:\computing project\Letters\Funders.doc", , , False
Case "Volunteers and Staff"
objWord.Documents.Open "d:\computing project\Letters\Workers.doc", , , False
Case "Everybody"
objWord.Documents.Open "d:\computing project\Letters\Everybody.doc", , , False
End Select
End Sub
**This code loads the correct document fine, but however disables the mail merge top toolbar on load - something that does not happen when the document that is being opened is opened directly from file.
It is important that my user can navigate between the records of the mail merged document otherwise they will only ever be able to do a personalised letter for the first person in the list!
Read only is not an issue as I have tried it with and without. at the moment I have set them to edit protection, so that the user can open in read only to print off, and a technical analyst can use the password to alter it.
Any help would be appreciated