By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,949 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,949 IT Pros & Developers. It's quick & easy.

Sending Output to a Word or Excel Doc/Spreadsheet

P: n/a
I have a simple app that logs details of my customers and the work done for
them. It uses a few tables in Access and allows me to keep a basic record of
things for my accountant.

How can I output the billing info from my app to the Word doc or maybe Excel
spreadsheet? I can gather all the info I need from a query but I have
trouble sticking into a word document so the info is placed in the correct
places in it. ie: name, address, billing info, amounts, etc.

I can create an instance of work in VB.Net but beyond that I'm lost. Could
somebody point me in the right direction for what must be a much used piece
of coding, or just provide any old advice??

Derek
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hey.

The easiest way to do this (assuming that you are using
standard word documents, etc.) is to edit the standard
documents so that the places where you would like to add
this data into are Text Fields. Then, for the properties
of the textfields, change the name to something you'll
remember (ie. txtName, txtAddr1, etc.). Then, add these
standard documents to the project as embedded resources.

In runtime, you'll want to extract these standard docs to
temp folders, and then load the docs into Word. Then,
you'll just cycle through all of the Document.FormFields
and find the one with the correct name (ie. txtName,
etc.) and set that FormField.Result to the string
representation of whatever that Field's data should be.

To do this, I'm assuming that you have an understanding
of the Word object model, and know how to extract
embedded resources. If you have any further questions,
or aren't too sure how to go about doing what I said
above, don't hesitate to shoot me an email and ask.

Good luck!
Ben

-----Original Message-----
I have a simple app that logs details of my customers and the work done forthem. It uses a few tables in Access and allows me to keep a basic record ofthings for my accountant.

How can I output the billing info from my app to the Word doc or maybe Excelspreadsheet? I can gather all the info I need from a query but I havetrouble sticking into a word document so the info is placed in the correctplaces in it. ie: name, address, billing info, amounts, etc.
I can create an instance of work in VB.Net but beyond that I'm lost. Couldsomebody point me in the right direction for what must be a much used pieceof coding, or just provide any old advice??

Derek
.

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.