473,395 Members | 1,464 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,395 software developers and data experts.

Automating Mail Merge from Access using xls file as datasource

I wrote the following code:
DoCmd.OutputTo acOutputTable, "tmpWorkSheet", acFormatXLS,
"C:\WS.xls", False, ""
Set oWordDoc = CreateObject("Word.Application")
oWordDoc.Application.Visible = True
'open word document
oWordDoc.Application.Documents.Open "C:\TESAOD_1.doc"
'assign datasource
With oWordDoc.Application.ActiveDocument.MailMerge
.MainDocumentType = 0
.OpenDataSource Name:="C:\WS.xls", Linktosource:=True, _
Connection:="tmpworksheet"
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
.EditMainDocument
.Execute Pause:=True
End With

The problem I am experiencing is that when the worddoc opens up at the
same time a popup appears asking the user to select the table
("tmpWorkSheet").
How can I get rid of this annoying popup?

Please help!!!

Thank you so much in advance,

Stefania
Nov 13 '05 #1
1 1456
You could output to text and use Albert's code...

http://www.attcanada.net/%7ekallal.m...rge/index.html
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
1
by: John Davy | last post by:
I am trying to set up a mail merge by automation using a text file as the data source but I keep getting the message "Requested object is not available" and the debugger stops on the...
0
by: pnr | last post by:
I transferred my database to a new computer. I can open it in 2003 Access, but am keeping it in the 2000 version until I get it working correctly. I have dozens of Word documents where I use...
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: Sheila | last post by:
I have set up a Word mail merge document of the type Directory which allows me to display all of the records on a single page rather than putting each record on a separate page. It uses a...
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...
1
by: Esther Lane | last post by:
Hello! First off, many many thanks to Albert who wrote the Mail Merge code for MS Access I am using. It has been working beautifully for a few years. However, my client just (without notice!)...
1
by: TommyGunn | last post by:
Hi everyone, Is there anyway to automatically put Access data into Mail Merge in an existing Word doc with content? I have bits and pieces of this done, but I can't seem to put it all together....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.