hello,
i am perfoming a mail merge with the following code.
Public Function MergeIt()
Dim objWord As Object
Set objWord = GetObject("C:\M yMerge.doc", "Word.Document" )
' Make Word visible.
objWord.Applica tion.Visible = True
' Set the mail merge data source as the db3 database.
objWord.MailMer ge.OpenDataSour ce _
Name:="C:\Rapid Motion\Client " & _
"Info\Accid ent Claims UK\db3.mdb", _
LinkToSource:=T rue, _
Connection:="TA BLE tblsolicitordet ails", _
SQLStatement:=" SELECT * FROM [tblsolicitordet ails]"
' Execute the mail merge.
objWord.MailMer ge.Execute
End Function
the first time i execute it, it fails because the word document does
not have the merge fields in place.
So i open the word document myMerge then set up the merge fields and
save it.
the second time i open it 2 instances of Word open, 1 with my merged
fields and all the merge options, and another that simply shows the
values of the merged fields and no merge options.
Why does this happen?
Aaron 2 3248
"Aaron" <aa***@rapid-motion.co.uk> wrote in message
news:26******** *************** ***@posting.goo gle.com... hello,
i am perfoming a mail merge with the following code.
Public Function MergeIt() Dim objWord As Object Set objWord = GetObject("C:\M yMerge.doc", "Word.Document" ) ' Make Word visible. objWord.Applica tion.Visible = True ' Set the mail merge data source as the db3 database. objWord.MailMer ge.OpenDataSour ce _ Name:="C:\Rapid Motion\Client " & _ "Info\Accid ent Claims UK\db3.mdb", _ LinkToSource:=T rue, _ Connection:="TA BLE tblsolicitordet ails", _ SQLStatement:=" SELECT * FROM [tblsolicitordet ails]" ' Execute the mail merge. objWord.MailMer ge.Execute End Function
the first time i execute it, it fails because the word document does not have the merge fields in place.
So i open the word document myMerge then set up the merge fields and save it.
the second time i open it 2 instances of Word open, 1 with my merged fields and all the merge options, and another that simply shows the values of the merged fields and no merge options.
Why does this happen?
Aaron
Your code includes a ' Execute the mail merge. objWord.MailMer ge.Execute
so the merge is executed and the output is made..
Where did you want it to go?
I think the default is to 'merge to a new document'
there is probably an argument for the others (printer or email) but having
not experiemented with these I can't help you with what they might be.
Mal. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Steve M |
last post by:
I'm trying to do invoke the mail merge functionality of MS Word from a
Python script. The situation is that I have a template Word document,
and a record that I've generated in Python, and I want to output a new
Word .doc file with the template filled in with the record I've
generated.
(To refresh your memory, in Word a mailmerge is achieved by a) under
Tools -> Letters and Mailings, check off Show Mail Merge Toolbar; b)
open a document...
|
by: William Wisnieski |
last post by:
Hi Everyone,
Access 2000
I have some code behind a button that performs a word merge with a query
data source. The merge works fine. But what I'd like to do somehow is
after the merge is generated (or before), assign the current date to the
field in the main table the query data source is based
on. Is this even possible? If so, how could I do it? Here is the code
that works so far:
|
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.
|
by: Andy Davis |
last post by:
I have set up a mail merge document in Word 2003 which gets its data from my
Access 2000 database. I want to set up a button on a form that:
1. runs the query to provide the dat for the merge document in Word;
2. opens the document and runs the merge process for the new data.
I have managed to write the code to perform step 1 ok, but I'm having
trouble with step 2. It opens the word document fine but does not perform
the mail merge of...
|
by: lesperancer |
last post by:
I have 3 tables (office97)
tblQuote
quoteNbr
tblDetails ( quote : 1 <-> M: quoteDetails)
quoteNbr
detailLine
product
value
| |
by: Ron B |
last post by:
Help!!!
What am I doing wrong? I am working with Office 2003 and am trying to create a command button on an Access form that will create a mail merge in Word from an Access table.
I want to make the mail merge seamless to the user so all they have to do is click on the command button and the letters are generated.
For the button I created an event procedure with the following code:
Private Sub RunLetters_Click()
|
by: crealesmith |
last post by:
Firstly, I have no problem with mail merging to Word, VB code for that
works perfectly.
On one mail merge I need to merge 15 fields of data that are from 3
seperate records.
The 3 records are all in the same table. If I use a control source that
is selecting the 3 records, all of the data is shown but spread over 3
pages in the mail merge, but needs to be listed together in one
paragraph.
Is there anyway of looping through the 3...
|
by: =?Utf-8?B?QmFkaXM=?= |
last post by:
Hi,
I'm trying to follow a mail merging example in C#.Net that I got from:
http://support.microsoft.com/default.aspx/kb/301659
and in one the methods:
Word.Application wrdApp;
Word._Document wrdDoc;
Object oMissing = System.Reflection.Missing.Value;
Object oFalse = false;
|
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!) upgraded from Access 2000 to Access 2007. Now that component is failing.
The merge is building the data source file fine (text file named merge.888).
I am providing an absolute path reference to the word file being used for the mail merge. ...
|
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,...
|
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...
| |
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,...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |