473,857 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3732
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******@earth link.net> schreef in bericht news:C0******** *******@newsrea d2.news.pas.ear thlink.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.Applicatio n

With objWord
Set docWord = objWord.Documen ts.Open(pstrDoc Name)
DoEvents
.Application.Vi sible = True
strC = "QUERY " + pstrDataSource
DoEvents
If Len(Trim(pstrDa taSource)) > 0 Then
If Len(Trim(docWor d.MailMerge.Dat aSource.Name)) = 0 And _
docWord.MailMer ge.DataSource.C onnectString <> "QUERY " +
pstrDataSource Then
strPath = CurrentDb.Name
'here is the line where I start getting the dialogs...
docWord.MailMer ge.OpenDataSour ce Name:=strPath, _
LinkToSource:=T rue, _
Connection:=str C, _
ReadOnly:=True
docWord.Save
End If
End If

"Arno R" <ar***********@ tiscali.nl> wrote in message
news:44******** **************@ text.nova.plane t.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******@earth link.net> schreef in bericht
news:C0******** *******@newsrea d2.news.pas.ear thlink.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******@earth link.net> schreef in bericht news:wR******** ********@newsre ad2.news.pas.ea rthlink.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.Applicatio n

With objWord
Set docWord = objWord.Documen ts.Open(pstrDoc Name)
DoEvents
.Application.Vi sible = True
strC = "QUERY " + pstrDataSource
DoEvents
If Len(Trim(pstrDa taSource)) > 0 Then
If Len(Trim(docWor d.MailMerge.Dat aSource.Name)) = 0 And _
docWord.MailMer ge.DataSource.C onnectString <> "QUERY " +
pstrDataSource Then
strPath = CurrentDb.Name
'here is the line where I start getting the dialogs...
docWord.MailMer ge.OpenDataSour ce Name:=strPath, _
LinkToSource:=T rue, _
Connection:=str C, _
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(strDa tacsv, strWordDoc)
Dim objWord As Object
Dim docWord As Object
Dim strActiveDoc As String
Set objWord = CreateObject("W ord.Application ")
Set docWord = objWord.Documen ts.Open(strWord Doc)
With docWord.MailMer ge
.OpenDataSource Name:=strDatacs v, LinkToSource:=T rue
.Destination = 0 ' 0 = new document
.SuppressBlankL ines = True
.Execute Pause:=True
End With
docWord.Close (False)

objWord.Visible = True
objWord.Windows (objWord.Window s.Count).Activa te
strActiveDoc = objWord.ActiveD ocument.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.plane t.nl...

"johnvon" <jo******@earth link.net> schreef in bericht
news:wR******** ********@newsre ad2.news.pas.ea rthlink.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.Applicatio n

With objWord
Set docWord = objWord.Documen ts.Open(pstrDoc Name)
DoEvents
.Application.Vi sible = True
strC = "QUERY " + pstrDataSource
DoEvents
If Len(Trim(pstrDa taSource)) > 0 Then
If Len(Trim(docWor d.MailMerge.Dat aSource.Name)) = 0 And _
docWord.MailMer ge.DataSource.C onnectString <> "QUERY " +
pstrDataSource Then
strPath = CurrentDb.Name
'here is the line where I start getting the dialogs...
docWord.MailMer ge.OpenDataSour ce Name:=strPath, _
LinkToSource:=T rue, _
Connection:=str C, _
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(strDa tacsv, strWordDoc)
Dim objWord As Object
Dim docWord As Object
Dim strActiveDoc As String
Set objWord = CreateObject("W ord.Application ")
Set docWord = objWord.Documen ts.Open(strWord Doc)
With docWord.MailMer ge
.OpenDataSource Name:=strDatacs v, LinkToSource:=T rue
.Destination = 0 ' 0 = new document
.SuppressBlankL ines = True
.Execute Pause:=True
End With
docWord.Close (False)

objWord.Visible = True
objWord.Windows (objWord.Window s.Count).Activa te
strActiveDoc = objWord.ActiveD ocument.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
2394
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 results of my research in case anyone else might need this information. I consulted with my MIS colleague, and he said it would be ok to have each merge file pull the whole database when the criteria screen is opened. His reasoning was that it...
2
3254
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. objWord.Application.Visible = True ' Set the mail merge data source as the db3 database.
1
3487
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 the data and spit out one or more PDF documents. It appears that the best thing for me to do is get a product that installs some type of printer driver. The problem is that the drivers pop up a dialog box prompting for the destination file...
0
1256
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 proper up-to-date ASP.NET solution. Microsoft Knowledge Base Article - 285176 refers to ASP http://support.microsoft.com/default.aspx?scid=kb;EN-US;q285176
1
12258
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 brings up the dialog "Confirm Data Source", and asks if I want to use OLE, DDE, or ODBC. If I say ODBC, it then asks me for the table name. If I do all that, the merge works correctly, but I don't want users to have to do all that. I thought the...
0
2211
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 resolve. I am trying to merge individual records into seperate mail merge word docs. In the past I linked my word files directly to the tables and then simply changed the QueryString of the merge file for the particular record I need to create a...
2
3382
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 confirm that I want to run a query to select the data from the data source file, then it opens the form letter fine. I can preview the merged records and complete a merge to a new document. I have a VB 2006 project (.net framework 2.0) which opens the...
7
7247
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 for any comments about the use of the docmd.transfertext method instead of the code Albert used for creating the text file. Also, perhaps some ideas for coding the Subject Line of each email so
1
5075
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 very little (actually probably nothing) about VBA and I'm currently learning my way around Access. Basically, I want to click a button in the form that merges the letter for me, only for the one record I'm currently viewing..not the whole...
0
9768
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10711
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10394
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9549
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7940
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7104
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5971
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4191
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.