?
Solved

Word Template Mail merge with vb.net

Posted on 2016-11-09
4
Medium Priority
?
125 Views
Last Modified: 2016-11-15
Hello,

Any suggestion how can I do mail merge (word) with vb.net and sql server query.
I have a word template which uses access db.But, now need the vb.net app to connect it with the sql server db.



Cheers
0
Comment
Question by:RIAS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 41880721
I think is like you just need to "Change the main data connection to another Microsoft Access database" but this one is SQL database tables instead of Access

https://support.office.com/en-us/article/Change-the-main-data-connection-to-another-Microsoft-Access-database-12376f25-3f74-407e-8ca5-53409cc2bcc3

Just look under "Change the main data connection in the form template" from above links where step 3. says: "3.On the next page of the wizard, click Database (Microsoft SQL Server or Microsoft Office Access only), and then click Next." so just select your SQL Server database and go from there.

And make sure you keep a copy of your original template somewhere safe before making/saving any changes.
1
 

Author Comment

by:RIAS
ID: 41880741
Ok, will give a go.
Need to intiate this from my vb.net app.
Any suggestions
0
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 41880754
"I have a word template which uses access db.But, now need the vb.net app to connect it with the sql server db."

So what's the connection between the word template above and VB .net???
If you just need to connect from VB .net to SQL - that's described for instance here: "VB.NET Database Tutorial - Connecting To Microsoft SQL Server" https://www.youtube.com/watch?v=odrntJn2o98 or here http://vb.net-informations.com/ado.net-dataproviders/ado.net-sqlconnection.htm
1
 

Author Comment

by:RIAS
ID: 41881829
Icohan,

Right now the word is not connected to vb.net.Its a standalone template with connection to access.

I have to now do this:

vb.net app ----connects to word ---which has the sql connection instead of Access

Cheers
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question