473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Automate Word Mail Merge - Conversion Issue

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
5 3706
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
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
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Julia Baresch | last post by:
Everyone, I posted the message below back in February and didn't get any information. I also wasn't able to find any documentation in MS Help, web site, or other groups. I'm posting now with...
2
by: Aaron | last post by:
hello, i am perfoming a mail merge with the following code. Public Function MergeIt() Dim objWord As Object Set objWord = GetObject("C:\MyMerge.doc", "Word.Document") ' Make Word visible....
1
by: Curtis Justus | last post by:
Hi, We have a project that requires a .NET service to convert a Word document to a PDF document. Basically, a person would create a mail merge template in Word and through automation, we merge...
0
by: Martin Feuersteiner | last post by:
Dear Group I wondered whether there's an ASP.NET example on how to automate word to perform a client-side mail merge? It looks like many people are asking the same question but haven't found a...
1
by: John Welch | last post by:
I'm trying to use the Mergit() function from the MS Knowledge base article to merge data from a query or table in my Access 2000 mdb into an existing word merge document. Every time it runs it...
0
by: mbbostwick | last post by:
I have a problem with a mail merge procedure I used to use with Access '97. We recently converted to Office XP (2002) and I now have an issue I am unfamilliar with and have been unable to...
2
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to...
7
by: giladp1 | last post by:
I found Albert Kallal's great "Super easy Word Merge" code in his site at: http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html Thanks Albert so much for sharing this. I am looking...
1
by: kayberrie | last post by:
I want to write a VBA mail merge code. I want to link the code/macro/dohicky to a nifty little button so it makes life easy. I think I can handle the button part, the code part - not so much. I know...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.