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

Perform Mail Merge - Stuck Up and Need Help

Hi,

I am not that experienced in VB.NET. I am working on a application where i have to perform mail merge from the application. The application lets the userwrite letters, save them as rtf file. In letter, tags are added programmatically for fields to add data while merging. User can use the letter later to perform mail merge on it to selected customers. Customers dataset is ready.

Now, can any one assist me how to move further to perform the mail merge stuff. Till now, I have a letter with tags in it like <<CompanyName>>, etc and a dataset with list of records. I have started off with the code ;

Expand|Select|Wrap|Line Numbers
  1.     Private Sub PerformMailMerge()
  2.         Dim wApp As New Word.Application
  3.         Dim wDoc As Word.Document
  4.         Dim wMailMerge As Word.MailMerge
  5.  
  6.         wDoc = wApp.Documents.Open(Me.CapFileName)
  7.         wApp.Visible = True
  8.         wDoc.Unprotect()
  9.  
  10.         wDoc.MailMerge.Destination = Word.WdMailMergeDestination.wdSendToNewDocument
  11.         wDoc.MailMerge.Execute()
I want to know how to add data for each record in the dataset and how will this mail merge work out.

Any help is appreciated. Please.

Thanks
Sep 3 '07 #1
0 970

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

Similar topics

2
by: Bob Hynes | last post by:
Hi All, This code is running in WinNT/Access97. I'm looking for some help with getting this code to do two(2) things better then it does now and I'm not sure how to do it. 1. On the...
2
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...
3
by: Traci | last post by:
I need to do a mail merge letter from my database. The letter will be addressed to small companies and in the body of the letter I need to list employees of the company. There will be from 1 to 15...
5
by: Tom Keane | last post by:
Okay, so the deal is, I am doing a mail merge document in order to print invoices. The field I get the amount of money is "invAmount". What I would like to do is be able to manipulate this number...
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...
0
by: Martin Feuersteiner | last post by:
Dear Group I wondered whether there's an ASP.NET example on how to automate word to perform a client-side mail merge? It looks like many people are asking the same question but haven't found a...
5
by: Simon | last post by:
on my database i have a customers Table (tblCustomers) on the form of it (frmCustomers) i would like a button what will open up word and open up my comapny letter head template and then merger...
6
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...
1
by: kayberrie | last post by:
I want to write a VBA mail merge code. I want to link the code/macro/dohicky to a nifty little button so it makes life easy. I think I can handle the button part, the code part - not so much. I know...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.