By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,500 Members | 2,809 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,500 IT Pros & Developers. It's quick & easy.

Automate Word Mail Merge - Conversion Issue

P: n/a
I have a mail merge that runs flawlessly in Access 2000. In 2003 I keep
getting dialog boxes that I can't figure out how to supress. Several of them
are telling me that Admin (me!) has the database opened (duh!). I then get a
logon dialog box, which I cancel. The merge then runs perfectly! How do I
supress all of these dialog boxes.

Thanks!

John
May 15 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Are you running the mail merge from within Access or within Word. In looking
at Access Help I see that you can export a table or query to a mail merge
source file or you can actually do a mail merge but it has to be within Word.
If the latter is you case, close Access.

johnvon wrote:
I have a mail merge that runs flawlessly in Access 2000. In 2003 I keep
getting dialog boxes that I can't figure out how to supress. Several of them
are telling me that Admin (me!) has the database opened (duh!). I then get a
logon dialog box, which I cancel. The merge then runs perfectly! How do I
supress all of these dialog boxes.

Thanks!

John


--
Message posted via http://www.accessmonster.com
May 15 '06 #2

P: n/a
I guess the new security-'features' that are 'nagging' you.
I suggest you post the code you are using now.

Arno R

"johnvon" <jo******@earthlink.net> schreef in bericht news:C0***************@newsread2.news.pas.earthlin k.net...
I have a mail merge that runs flawlessly in Access 2000. In 2003 I keep
getting dialog boxes that I can't figure out how to supress. Several of them
are telling me that Admin (me!) has the database opened (duh!). I then get a
logon dialog box, which I cancel. The merge then runs perfectly! How do I
supress all of these dialog boxes.

Thanks!

John

May 15 '06 #3

P: n/a
Here is the code I am using. I pass a data source (pstrDataSource) to the
function in case the data source is missing:

Set objWord = New Word.Application

With objWord
Set docWord = objWord.Documents.Open(pstrDocName)
DoEvents
.Application.Visible = True
strC = "QUERY " + pstrDataSource
DoEvents
If Len(Trim(pstrDataSource)) > 0 Then
If Len(Trim(docWord.MailMerge.DataSource.Name)) = 0 And _
docWord.MailMerge.DataSource.ConnectString <> "QUERY " +
pstrDataSource Then
strPath = CurrentDb.Name
'here is the line where I start getting the dialogs...
docWord.MailMerge.OpenDataSource Name:=strPath, _
LinkToSource:=True, _
Connection:=strC, _
ReadOnly:=True
docWord.Save
End If
End If

"Arno R" <ar***********@tiscali.nl> wrote in message
news:44**********************@text.nova.planet.nl. ..
I guess the new security-'features' that are 'nagging' you.
I suggest you post the code you are using now.

Arno R

"johnvon" <jo******@earthlink.net> schreef in bericht
news:C0***************@newsread2.news.pas.earthlin k.net...
I have a mail merge that runs flawlessly in Access 2000. In 2003 I keep
getting dialog boxes that I can't figure out how to supress. Several of them are telling me that Admin (me!) has the database opened (duh!). I then get a logon dialog box, which I cancel. The merge then runs perfectly! How do I
supress all of these dialog boxes.

Thanks!

John

May 16 '06 #4

P: n/a

"johnvon" <jo******@earthlink.net> schreef in bericht news:wR****************@newsread2.news.pas.earthli nk.net...
Here is the code I am using. I pass a data source (pstrDataSource) to the
function in case the data source is missing:

Set objWord = New Word.Application

With objWord
Set docWord = objWord.Documents.Open(pstrDocName)
DoEvents
.Application.Visible = True
strC = "QUERY " + pstrDataSource
DoEvents
If Len(Trim(pstrDataSource)) > 0 Then
If Len(Trim(docWord.MailMerge.DataSource.Name)) = 0 And _
docWord.MailMerge.DataSource.ConnectString <> "QUERY " +
pstrDataSource Then
strPath = CurrentDb.Name
'here is the line where I start getting the dialogs...
docWord.MailMerge.OpenDataSource Name:=strPath, _
LinkToSource:=True, _
Connection:=strC, _
ReadOnly:=True
docWord.Save
End If
End If

Sorry, I see now that I misread your initial question.

I thought you had difficulty with Word2003 compared with Word2000.
I also had the same issues with that.
But you said that Access2003 was the culprit here.

I see you are connection to the same database that you are working with.
When you secure the db you will get even more login issues.
I would use an 'outside' connection. Export the records and fields you need to a csv-file.

I create (and test) a csv-file prior to the merge-code.
Don't know if this helps you since it is not exactly what you asked, but the following code works for me (late binding).

Sub MergeWord(strDatacsv, strWordDoc)
Dim objWord As Object
Dim docWord As Object
Dim strActiveDoc As String
Set objWord = CreateObject("Word.Application")
Set docWord = objWord.Documents.Open(strWordDoc)
With docWord.MailMerge
.OpenDataSource Name:=strDatacsv, LinkToSource:=True
.Destination = 0 ' 0 = new document
.SuppressBlankLines = True
.Execute Pause:=True
End With
docWord.Close (False)

objWord.Visible = True
objWord.Windows(objWord.Windows.Count).Activate
strActiveDoc = objWord.ActiveDocument.Name
DoCmd.Hourglass False
Set objWord = Nothing
Set docWord = Nothing
AppActivate strActiveDoc
Exit Sub

Arno R
May 16 '06 #5

P: n/a
Arno,

Thanks! I'm glad to see someone has a work around!

John

"Arno R" <ar***********@tiscali.nl> wrote in message
news:44**********************@text.nova.planet.nl. ..

"johnvon" <jo******@earthlink.net> schreef in bericht
news:wR****************@newsread2.news.pas.earthli nk.net...
Here is the code I am using. I pass a data source (pstrDataSource) to the
function in case the data source is missing:

Set objWord = New Word.Application

With objWord
Set docWord = objWord.Documents.Open(pstrDocName)
DoEvents
.Application.Visible = True
strC = "QUERY " + pstrDataSource
DoEvents
If Len(Trim(pstrDataSource)) > 0 Then
If Len(Trim(docWord.MailMerge.DataSource.Name)) = 0 And _
docWord.MailMerge.DataSource.ConnectString <> "QUERY " +
pstrDataSource Then
strPath = CurrentDb.Name
'here is the line where I start getting the dialogs...
docWord.MailMerge.OpenDataSource Name:=strPath, _
LinkToSource:=True, _
Connection:=strC, _
ReadOnly:=True
docWord.Save
End If
End If

Sorry, I see now that I misread your initial question.

I thought you had difficulty with Word2003 compared with Word2000.
I also had the same issues with that.
But you said that Access2003 was the culprit here.

I see you are connection to the same database that you are working with.
When you secure the db you will get even more login issues.
I would use an 'outside' connection. Export the records and fields you need
to a csv-file.

I create (and test) a csv-file prior to the merge-code.
Don't know if this helps you since it is not exactly what you asked, but the
following code works for me (late binding).

Sub MergeWord(strDatacsv, strWordDoc)
Dim objWord As Object
Dim docWord As Object
Dim strActiveDoc As String
Set objWord = CreateObject("Word.Application")
Set docWord = objWord.Documents.Open(strWordDoc)
With docWord.MailMerge
.OpenDataSource Name:=strDatacsv, LinkToSource:=True
.Destination = 0 ' 0 = new document
.SuppressBlankLines = True
.Execute Pause:=True
End With
docWord.Close (False)

objWord.Visible = True
objWord.Windows(objWord.Windows.Count).Activate
strActiveDoc = objWord.ActiveDocument.Name
DoCmd.Hourglass False
Set objWord = Nothing
Set docWord = Nothing
AppActivate strActiveDoc
Exit Sub

Arno R
May 17 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.