Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can mail-merge but my user can't (Access and Word 2000)

Status
Not open for further replies.

rlh145

Programmer
Feb 19, 2001
36
US
Here is my predicament:

I converted a small MS Access 97 about a year ago to MS Access 2000. There was a problem with the mail merge component. I stumbled around and finally got it to work when I used it. But my user still can't run the mail merge
component. This user can update the Access database with no problems.

I have had my LAN person check out all the rights on the network drive and they are ok. The merge letter template and the Access database are in the same directory. What I am trying to determine is "Have I overlooked something?"


Here is some code from the program that sets up the directories for the actual merge: Thanks for Looking!! Ralph


Private Sub GetEnvironment()
'Returns reference to default workspace.
Set wspJet = DBEngine.Workspaces(0)
'Returns reference to current database.
Set dbsRecipient = CurrentDb()

Set rstRecipient = dbsRecipient.OpenRecordset("tblEnvironment", dbOpenDynaset)
rstRecipient.MoveFirst

FormPath = rstRecipient!FormLocation
SavePath = rstRecipient!Savelocation

'FormPath = "\\NRDCS01\VOL1\DATA\DFM\SHARED\subrecpt\"
'SavePath = "\\NRDCS01\VOL1\DATA\DFM\SHARED\subrecpt\Letters\"
End Sub


Here is the code for the actual merge:

Select Case countLetter
Case 1
Set MyWord = GetObject(FormPath + "mergeLetter1.doc")
'Set MyWord = GetObject(FormPath + "mrgflrap.doc")
Case 2
Set MyWord = GetObject(FormPath + "mergeLetter2.doc")
'Set MyWord = GetObject(FormPath + "slrap.doc")
Case 3, 8, 12
Set MyWord = GetObject(FormPath + "mergeLetter3.doc")
'Set MyWord = GetObject(FormPath + "arc.doc")
Case 4
Set MyWord = GetObject(FormPath + "mergeLetter4.doc")
'Set MyWord = GetObject(FormPath + "wf-nap.doc")
Case 5
Set MyWord = GetObject(FormPath + "mergeLetter5.doc")
'Set MyWord = GetObject(FormPath + "flrcapr.doc")
Case 6
Set MyWord = GetObject(FormPath + "mergeLetter6.doc")
'Set MyWord = GetObject(FormPath + "slrcapr.doc")
Case 7
Set MyWord = GetObject(FormPath + "mergeLetter7.doc")
'Set MyWord = GetObject(FormPath + "rlnocap.doc")
Case 9
Set MyWord = GetObject(FormPath + "mergeletter9.doc")
'Set MyWord = GetObject(FormPath + "fl-cr.doc")
Case 10
Set MyWord = GetObject(FormPath + "mergeLetter10.doc")
'Set MyWord = GetObject(FormPath + "sl-cr.doc")
Case 11
Set MyWord = GetObject(FormPath + "mergeletter11.doc")
'Set MyWord = GetObject(FormPath + "rl-nc.doc")
End Select

MyWord.mailmerge.Execute

Set MyDoc = GetObject(MyWord.Application.ActiveWindow)

Select Case countLetter
Case 1
MyDoc.saveAs SavePath + AutoNo + "flrap.doc"
'MyDoc.saveAs SavePath + "Letter1.doc"
'MyDoc.PrintOut, , , , 2
'MyWord.saveAs FormPath + AutoNo + "mergeflrap.doc"
MyWord.saveAs FormPath + "mergeLetter1.doc"

Case 2
MyDoc.saveAs SavePath + AutoNo + "Letter2.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter2.doc"
Case 3, 8, 12
MyDoc.saveAs SavePath + AutoNo + "Let3.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter3.doc"
Case 4
MyDoc.saveAs SavePath + AutoNo + "Letter4.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter4.doc"
Case 5
MyDoc.saveAs SavePath + AutoNo + "Let5.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter5.doc"
Case 6
MyDoc.saveAs SavePath + AutoNo + "Let6.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter6.doc"
Case 7
MyDoc.saveAs SavePath + AutoNo + "Let7.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter7.doc"
Case 9
MyDoc.saveAs SavePath + AutoNo + "Let9.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter9.doc"
Case 10
MyDoc.saveAs SavePath + AutoNo + "Let10.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter10.doc"
Case 11
MyDoc.saveAs SavePath + AutoNo + "Let11.doc"
'MyDoc.PrintOut , , , , 2
MyWord.saveAs FormPath + "mergeLetter11.doc"
End Select

MyWord.Application.Quit
Call sRestoreTitle
Set MyWord = Nothing


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top