473,732 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Microsoft Word Mailmerge in VB.NET Program

1 New Member
Hope someone can shed some light on a tricky error.

I am trying to automate a mailmerge in VB.NET using Word 2003. The main document is a previously existing Word file. The data source is a text file created by a separate Oracle SQL program. The main document is linked to the data source; if you open the main doc manually, you get the SQL security message for the name of the text file.

When the program runs the OpenDataSource command for the text file, the “file is locked for editing” dialog box pops up to request the desired course of action. Once the user makes a choice, the merge completes. Unfortunately, this prevents the merge from running automatically.

One comment in a Web post says that when a main document is opened through Automation, the data source is not attached to it. However, it looks like the command to open the main document causes the data source document to be locked as if it had been opened. A check of Task Manager does not show the data source open as a separate process.

It would be greatly appreciated if someone can tell me how to work around this problem or supply an example of mailmerge code using a text file as the data source. Thanks.
Sep 3 '08 #1
0 1299

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4466
by: Allcomp | last post by:
Hello, I have a problem with a VB6 program that command a mailmerge with word object. The database is a MSDE Database. In the two cases, the server is the same The file c:\res.odc is empty (0 bytes), it is just here because Word want it to be there.
2
4933
by: Bud Zielinski | last post by:
Some of our users have converted to Office 2003. Our Access app is in 2000. they run it in Access 2003 with Access 2000 as the default file format. When doing a merge from the partial code segment below, we had rec'd the : "Opening this will run the following SQL Command" message. We were able to suppress that message with registry changes and code contained in MSKB 82765.
8
9521
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 each person for whom a mail merge letter is desired. The query reads address info from the table for each record where is true.
1
2203
by: Shannon Rotz | last post by:
I'm trying to automate Word XP from Access XP with the following function. The sqlstmt argument is "Select * from where ". I understand that Microsoft Word mailmerge changed its default data source to OLEDB, so I took a look in the KB on how to do this. According to Q285332, my function should work - but it doesn't! I keep getting "Cannot open data source" or the "Confirm data source" dialog box. I have tried this with and without the...
2
4815
by: Ray Todd Jr | last post by:
Could someone please look at this code and tell me what I am missing, please? The problem that is occuring is I am given an error (5922) that states "Word was unable to open the data source" As an overview, I have a form where you can put the criteria to select the data you want to print the forms by, the form has runreport button witht he following code. When I click on the button, I get the above mentioned error. If I remove the...
4
12053
by: Ray Todd Jr | last post by:
I can't get ths code to correctly execute. After I have clicked on a Access Form, I want the code to open the word document, merge the data, print the forms and then close the two windows that open of Word. The Mail Merge takes place, and the sticking point is that I have to manually close the two Word Windows. Can someone please tell me what I'm not doing correctly. Below is the code I am using...
4
7472
by: pmhaupt2 | last post by:
I developed an Access 2003 program that will allow the user to produce a group of Word letters that merge with data records from an Access database. I created a mail merge Word document and associated it with a specific query in my Access database. My problem is that when I run my "create letters" button from an Access form, the program opens up Word correctly with the proper letter. However, the MailMerge toolbar in Word appears...
0
2198
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...
3
2557
prn
by: prn | last post by:
Hi folks, I'm trying to create letters based on an Access database. I'm using Access 2003 and Word 2003. Most of the data tables are actually on a SQL server and Access is the front end for them. I have the boilerplate for my letter ready. Now, with Access open and connected to the SQL server, I open Word with the file I want, click "Tools", "Letters and Mailings" and select MailMerge. Word allows me to select the document type, with...
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9307
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...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
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...
1
6735
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
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
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
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.