473,498 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AccessXP/WordXP mailmerge

Hi All,
I have this older code(see below) that I used for a mailmerge in
another application, I'm looking to do something similar but a little
different in that, this time I have a single record to merge and after
the merge to the document I want to store it on a particular server in
a particular folder with a particular file name and I don't know what
the coding would be for that.
I assume it would go in place of the "objWord.MailMerge.Destination =
wdSendToPrinter" statement.
Can anyone tell me what the vba code would be?
thanks
bobh.

'start the mail merge process for creating filling in the word doc
Dim objWord As Word.Document
Set objWord = GetObject("\\HanClus\Corpshare\CommonDBs\ComunRat\ Docs
\FoundationChk.doc", "Word.Document")
'Make Word visible.
objWord.Application.Visible = True
'Set the mail merge data source as the database containing the mail
merge data.
objWord.MailMerge.OpenDataSource _
Name:="\\HanClus\Corpshare\CommonDBs\ComunRat\Apps
\CommRelationsFE.mdb", _
LinkToSource:=False, _
Connection:="Table tblDataForCReq", SQLStatement:="Select * from
[tblDataForCReq]"
'Execute the mail merge.
objWord.MailMerge.Destination = wdSendToPrinter
objWord.MailMerge.Execute
'close the Word application
objWord.Application.Quit
Set objWord = Nothing

Apr 12 '07 #1
0 1271

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

Similar topics

3
5709
by: Steve | last post by:
Recently due to viruses I had to wipe my harddrive and reload everything. Now, in AccessXP(2000 and XP mode) all new reports and all reports in existing databases open in Fit to Page rather than...
2
1909
by: Shannon Rotz | last post by:
I have a function in a Microsoft Access module (below) which creates a Word XP Mailmerge document, drawing the data from Access XP. I can get the connection to work fine. However, when I create...
0
1306
by: Bob Hynes | last post by:
Hi All, In one of my Access97 db applications I created a report which I output to a RichTextFormat file attach it to an Email and send it out, that has worked just fine for a couple of years now....
4
12034
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...
0
1070
by: RH | last post by:
Hi, I'm trying to use mailmerge with Word2003 from an asp.net webpage I'm using the following code: Dim W As New Word.Application Dim D As Word.Document = W.Documents.Open("maindoc.doc")...
2
13479
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to...
0
1388
by: Anne Richmond | last post by:
I have a Word(2000) mailmerge routine (code below) which works OK but always names the merged document "Forml Letters1". How do I change this to something else? Also how do I automatically save...
0
1580
by: Bob Smith | last post by:
I have existing word documents that we need to have the data document reflect whether we're running in development, test or production. The data header is longer than 255 characters, so I cannot...
1
1002
by: rippoliti | last post by:
I have a Wordxp macro using VB already written to extract information from the ODMA handles and format the information to appear in the footer. I want to be able to have that information appear...
0
7125
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
7004
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...
0
7167
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,...
0
7208
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...
1
6890
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...
0
7379
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...
1
4915
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...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
657
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.