Solved

Word Template Mail merge with vb.net

Posted on 2016-11-09
4
56 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
  • 2
  • 2
4 Comments
 
LVL 39

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 39

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

919 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now