I use Access97 to control Word97 as an object. Now I want to have a mailmerge document use a predefined query stored in the Access application as datasource. When loading the document Word starts a second instance of Access prompting the user to enter username and password again as the database is secured.
Is there any way of telling Word to use that instance of Access which has created the Word-object in order to avoid the second user-authorization?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Controlling Word Mailmerge
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Controlling Word Mailmerge
- This topic has 11 replies, 9 voices, and was last updated 23 years, 4 months ago.
AuthorTopicWSMartinT
AskWoody LoungerJanuary 4, 2001 at 11:15 am #351561Viewing 4 reply threadsAuthorReplies-
WScharlotte
AskWoody LoungerJanuary 7, 2001 at 5:25 am #509482Unfortunately, this was “feature” of Office 97, and was why I never used Access as a direct datasource for a mail merge. You can export the query to a text file with a fixed name using TransferText and make that text file the datasource for your Word mail merge. I did this in code, killing the existing file and replacing it with the new file for the mail merge. One problem I found was that I had to do an export and manually link the Word mail merge document to that text file the first time. After that, it would read the new version of the text file automatically.
-
WSMartinT
AskWoody LoungerJanuary 7, 2001 at 3:24 pm #509536Thank you, Charlotte and greisz.
Using TransferText was in fact the alternative I successfully use. I just wondered, whether there was really no way of getting it to work the other way. Has this changed with Access2K?BUT: Strange enough, after installing Microsofts Y2K-Patch ontop of Office97 SR-2, “DoCmd.TransferText acExportMerge” does not work with .doc files anymore, it shows error 3027 (“database or object write protected”). Using a .txt file instead works fine. But Word will not accept the .txt as datasource for mailmerge anymore, so I have to rename the .txt to .doc after creation. Any hints to why this happens?
-
WScharlotte
AskWoody LoungerJanuary 7, 2001 at 5:09 pm #509551 -
WSCary
AskWoody LoungerJanuary 7, 2001 at 6:24 pm #509579This may not be your problem, but I know for a fact that it solved my problem. While trying a Word merge from Access for labels, it also opened a second “Access”. What was causing it was this. When you create an Access DB you can set the start up options like the opening form and you can give your database file an application name that appears on the icon on your task bar. This name was causing word to open a second Access. Once I removed the “application name”, it stopped opening the second one. I hope this fixes your problem. By the way this was with Access 97. I dont have 2000 yet.
Cary -
WScharlotte
AskWoody Lounger
-
-
-
-
-
WSRichP
AskWoody LoungerJanuary 15, 2001 at 3:38 pm #510475 -
WSCharliesDaughter
AskWoody Lounger -
WSS_Cosgrove
AskWoody LoungerMay 31, 2001 at 2:05 am #527905This is from Office 2K, but I remember it being similar or the same in Office ’97. When you have the Word document open, click Tools | Mail Merge. When you get to step 2, if you choose “Open Data Source” it pops up a window to choose the source, and next to the file type field is the “Select Method” check box. I tried this for my mailmerge code, but it did not stop my Access db from opening another instance. Hope this helps.
-
-
WSJohnHW
AskWoody LoungerFebruary 11, 2002 at 1:07 pm #569672Hi
I am a new to this forum and a newbe when it comes to Visual Basic in Access. I have having a similar problem and would like to take you up on your offer of details of your technique of using text files. Tried this but could not get it to work.I use an Access 97 Db to track cases I deal with. When viewing a record I want to click a button which will open a standard letter in Word 97 with the person name and address filled in. To do this I use a query with picks up the record number from the current form and then collects the fields I need from the various tables.
I have tried using the mailmerge method described in Article Q159328 but cannot work out how to pass the record number parameter. It runs OK but prompts for the record number in Access.
Any help would be GREAT!
)
JohnHW
Like databases but struggling with VB. -
WBell
AskWoody_MVPFebruary 11, 2002 at 2:21 pm #569691This has been a problem with mail merges since Office 95, and it still is with Office XP. Two things contribute to this problem. The first is having security turned on – i.e. having a password for the Admin account. The second is renaming your application either in code or via the startup options. The first one you can’t do much about, but the second problems can be done by renaming your application as “Microsoft Access: MY APPLICATION” – apparently when Word starts the merge it looks at the application name expecting to find “Microsoft Access” and when it doesn’t, it starts another instance of Access.
We typically execute the merge from Access using OLE Automation code which solves some but not all of the problems associated with mergeing. This is a fairly complicated subject – most unfortunate because it’s a very powerful tool when it works correctly. We wrote an article a few months ago that you may find useful – you can find it on Woody’s Access Watch Vol 3 No 20. It includes several tips for making merges work reliably, and some sample code to do merges from Access.
-
WSJon Dean
AskWoody LoungerFebruary 12, 2002 at 12:23 pm #569915I wrote the following code for Access 97 and have since upgraded the database to 2K. It has always worked fine, though it can be slow, and you have to be careful with mapped network drives as they can cause another Access to start.
The letters themselves are mail merge linked from Word to a standard query in the database, and all have a AutoOpen macro which specifies the document name. Is this a good way to do it? Would another method be quicker?This first procedure sets the path for Word and the letters to be used.
Public Sub WordandDocPaths()
WordLocation = “C:Program FilesMicrosoft OfficeOfficeWINWORD.EXE”
DocLocation = “server1group datadatabasesDCDATA”End Sub
This procedure determines whether or not Word is already running. If No, word is started and the appropriate letter loaded. If yes, the current instance of Word is used.
Sub openletter()
Dim wrd As Object
On Error Resume Next
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Set wrd = GetObject(, “Word.Application”)
If Err.Number 0 Then
Call Shell(WordLocation & ” “”” & DocLocation & StdLet, 1)Else: wrd.Documents.Open DocLocation & StdLet
wrd.wdWindowStateNormal = 0
End IfAppActivate (“Microsoft Word”)
Set wrd = Nothing
End Sub
Each button on the form has the following code to set the value of stdlet so the correct letter is loaded:
Private Sub CommandGeneralLetter_Click()
On Error GoTo CommandGeneralLetter_Click_ErrStdLet = “ack0.doc”
Call WordandDocPaths
Call openletter
CommandGeneralLetter_Click_Exit:
Exit SubCommandGeneralLetter_Click_Err:
MsgBox Error$
Resume CommandGeneralLetter_Click_ExitEnd Sub
-
Viewing 4 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
3 hours, 35 minutes ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
7 hours, 15 minutes ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
4 hours, 32 minutes ago -
System Restore and Updates Paused
by
veteran
9 hours, 45 minutes ago -
Windows 10/11 clock app
by
Kathy Stevens
3 hours, 47 minutes ago -
Turn off right-click draw
by
Charles Billow
12 hours, 59 minutes ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
16 hours, 30 minutes ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
5 hours, 33 minutes ago -
Master patch listing for June 10, 2025
by
Susan Bradley
18 hours, 7 minutes ago -
Suggestions for New All in One Printer and a Photo Printer Windows 10
by
Win7and10
40 minutes ago -
Purchasing New Printer. Uninstall old Printer Software First?
by
Win7and10
1 day ago -
KB5060842 Issue (Minor)
by
AC641
1 day, 4 hours ago -
EchoLeak : Zero Click M365 Copilot leak sensitive information
by
Alex5723
1 day, 7 hours ago -
24H2 may not be offered June updates
by
Susan Bradley
5 hours, 51 minutes ago -
Acronis : Tracking Chaos RAT’s evolution (Windows, Linux)
by
Alex5723
1 day, 19 hours ago -
June 2025 updates are out
by
Susan Bradley
8 hours, 5 minutes ago -
Mozilla shutting Deep Fake Detector
by
Alex5723
2 days, 10 hours ago -
Windows-Maintenance-Tool (.bat)
by
Alex5723
1 day, 19 hours ago -
Windows 11 Insider Preview build 26200.5641 released to DEV
by
joep517
2 days, 13 hours ago -
Windows 11 Insider Preview build 26120.4250 (24H2) released to BETA
by
joep517
2 days, 13 hours ago -
Install Office 365 Outlook classic on new Win11 machine
by
WSrcull999
2 days, 13 hours ago -
win 10 to win 11 with cpu/mb replacement
by
aquatarkus
2 days, 4 hours ago -
re-install Windows Security
by
CWBillow
2 days, 16 hours ago -
WWDC 2025 Recap: All of Apple’s NEW Features in 10 Minutes!
by
Alex5723
2 days, 20 hours ago -
macOS Tahoe 26
by
Alex5723
2 days, 14 hours ago -
Migrating from win10 to win11, instructions coming?
by
astro46
4 hours, 57 minutes ago -
Device Eligibility for Apple 2026 Operating Systems due this Fall
by
PKCano
2 days, 4 hours ago -
Recommended watching : Mountainhead movie
by
Alex5723
2 days, 5 hours ago -
End of support for Windows 10
by
Old enough to know better
4 hours, 22 minutes ago -
What goes on inside an LLM
by
Michael Covington
5 hours, 18 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.