Solved

Word Template Mail merge with vb.net

Posted on 2016-11-09
4
83 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 500 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

726 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