Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Excel to Word Document

  Asked By: Robert    Date: Oct 28    Category: MS Office    Views: 843
  

I have a small query regarding the Excel VBA. I have created a VBA form
and four text boxes init. Once I enter the data in the textbox, I need
those values to be moved to worddocument bookmarks.

Can someone help me in writing this code?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Earl Stone     Answered On: Oct 28

You can do that via ADO. And you'll need to pick the app that will run the
show. I usually start in Word and pull the data  in from Access, which I use
more than Excel. But you can do it the same way by using similar code  and an
Excel ADO Provider (driver). It's kinda like you tell Word to link up to
Excel through this ADO data wrapper (like a tunnel) and you tunnel in and
pull what you need and then place the info into the bookmarks. Although you
can also run the show from Excel to deal with Word that way, which may be
more comfortable for you.

I have a demo of how it works...with an article explaining the process in
more detail and a demo you can download to play with and also open code you
can experiment with and use to get you started.

See this link: http://www.mousetrax.com/techpage.html#autoforms. Scroll down
to the Please Fill Out This Form series and locate the article # 5 for
Database Connectivity. Read the article and download the sample. You'll need
to change the Access JET Provider line of code to the Excel version...which
you can find here: http://www.connectionstrings.com/

And as for the bookmark and Word end of it...I have a pile of articles also
at that main autoforms link that will show you how to work around those
issue...so check out those articles, too.

 
Didn't find what you were looking for? Find more on Excel to Word Document Or get search suggestion and latest updates.




Tagged: