Word Data Acquisition 101

J

JTH

I have VBA code for Excel that gathers the data from a worksheet for export
to another application. The knuckleheads I work for now want the data to be
in a word doc / table instead of Excel. I have not idea where to start with
Word.

Idea #1 - Embed a XLM Excel in the word doc and figure out how to access the
data that way.

Idea #2 - Use bookmarks to index the needed fields????

Idea # 3 - Cry

I have no idea about the Word Object Model. Any ideas??? Starting place???
 
J

Jonathan West

JTH said:
I have VBA code for Excel that gathers the data from a worksheet for
export
to another application. The knuckleheads I work for now want the data to
be
in a word doc / table instead of Excel. I have not idea where to start
with
Word.

Idea #1 - Embed a XLM Excel in the word doc and figure out how to access
the
data that way.

Idea #2 - Use bookmarks to index the needed fields????

Idea # 3 - Cry

I have no idea about the Word Object Model. Any ideas??? Starting place???

The Document object have a Tables collection. Each Table object has a Cell
collection. So if you want the text out of the cell in row 3, column 5, then
this will do the trick

MsgBox ActiveDocument.Tables(1).Cell(3, 5).Range.Text

You may also find this article helpful on the Word object model

Getting To Grips With VBA Basics In 15 Minutes
http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top