U
Ultraviolet47
Hi
I have an Access 03 db with a password. I have posed on here before
that when I start the merge which is based on a query, it asks 3 times
for a password,then mail merges, even if I press cancel. Some people
kindly posted back, but suggestions didn't work.
If I click "test connction" it says it cannot start the application as
the work group file is missing or in use by another application?
Access is already open and the code opens Word?
I have added some code found of MS Support to enter the password in
the merge, but it still asks for the passwords and gives that error.
Does anyone know why it still mail merges when cancel is clicked 3
times?! Can anyone spot anything wrong with the code?
I'd really appreciate you help guys!
Dim MyConn As New ADODB.Connection
MyConn.Provider = "Microsoft.Jet.OLEDB.4.0"
MyConn.Properties("Data Source") = "C:\Documents and Settings\Stel
\My Documents\Cavy\Sponsorship pack\Sponsors\CavyRescue.mdb"
MyConn.Properties("Jet OLEDBatabase Password") = "mypassword"
MyConn.Open
Dim objWord As Word.Document
Set objWord = GetObject("C:\Documents and Settings\Stel\My Documents
\Cavy\Sponsorship pack\Sponsors\welcome letter.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Rat Rescue database.
objWord.MailMerge.OpenDataSource _
Name:="C:\Documents and Settings\Stel\My Documents\Cavy
\Sponsorship pack\Sponsors\CavyRescue.mdb", _
LinkToSource:=True, _
Connection:="QUERY Qry_WelcomeLetter", _
SQLStatement:="SELECT * FROM [Qry_WelcomeLetter]"
' Execute the mail merge.
objWord.MailMerge.Execute
End Sub
I have an Access 03 db with a password. I have posed on here before
that when I start the merge which is based on a query, it asks 3 times
for a password,then mail merges, even if I press cancel. Some people
kindly posted back, but suggestions didn't work.
If I click "test connction" it says it cannot start the application as
the work group file is missing or in use by another application?
Access is already open and the code opens Word?
I have added some code found of MS Support to enter the password in
the merge, but it still asks for the passwords and gives that error.
Does anyone know why it still mail merges when cancel is clicked 3
times?! Can anyone spot anything wrong with the code?
I'd really appreciate you help guys!
Dim MyConn As New ADODB.Connection
MyConn.Provider = "Microsoft.Jet.OLEDB.4.0"
MyConn.Properties("Data Source") = "C:\Documents and Settings\Stel
\My Documents\Cavy\Sponsorship pack\Sponsors\CavyRescue.mdb"
MyConn.Properties("Jet OLEDBatabase Password") = "mypassword"
MyConn.Open
Dim objWord As Word.Document
Set objWord = GetObject("C:\Documents and Settings\Stel\My Documents
\Cavy\Sponsorship pack\Sponsors\welcome letter.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Rat Rescue database.
objWord.MailMerge.OpenDataSource _
Name:="C:\Documents and Settings\Stel\My Documents\Cavy
\Sponsorship pack\Sponsors\CavyRescue.mdb", _
LinkToSource:=True, _
Connection:="QUERY Qry_WelcomeLetter", _
SQLStatement:="SELECT * FROM [Qry_WelcomeLetter]"
' Execute the mail merge.
objWord.MailMerge.Execute
End Sub