[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Exporting Data to Word From Access via VB?

Hi Guys,

I have an app that works great and the boss has asked me if he can export some of the data to Word and Excel.  The app is in VB and the data coming from an Access db.  

Is there a way to set up a template and just feed the records from vb to word?  Does anyone have any examples?

Sorry, I know it's a broad question but I'm quite clueless about it.  I've tried this http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=3799&lngWId=1 but I don't understand it :)

Cheers
Jet
0
jetgrrrl
Asked:
jetgrrrl
2 Solutions
 
EDDYKTCommented:
See whether it help

using ado from access to excel


http://erlandsendata.no/english/index.php?t=envbadac
0
 
jetgrrrlAuthor Commented:
oops, wrong paste... I've looked at this http://www.freevbcode.com/ShowCode.asp?ID=2562 not the above paste :)
0
 
jetgrrrlAuthor Commented:
Hi EDDYKT,

All those exmples assume I'm in either Access or Excel, I noticed I already had the page bookmarked so I know I've already failed to understand it.

Sorry,
Jet
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
EDDYKTCommented:
The easy thing is you just write your data to some delimiter file such as csv(comma delimiter) file so that it can read from excel
0
 
Erick37Commented:
Here is a good place to start:

Automating Microsoft Office
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2kta/html/offaut.asp

and

How To Automate Microsoft Word by Using Visual Basic to Create a New Document
http://support.microsoft.com/kb/313193/EN-US/
0
 
Ryan ChongCommented:
try create a Mail Merge document, and link the Mail Merge data source to a Query from your Access database?
0
 
sbennettsCommented:
If they are specific record types you need, you could set up a mail merge document in word and use the word object to pass the data to the mail merge document.
0
 
2AngelCommented:
Hi,

I am not an expert but I think the "very easy" way is to open your Access db, create a new macro for exporting the data to an MsWord or MsExcel (there is a wizerd for it... ) and then just call this macro from you VB program, or you can resave the macro as a VBA code and then call it from your VB program.
Is is possible?

Regards.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now