D
Dennis Snelgrove
I'm writing a VBA routine in Access to compile an email message
regarding entries in a database. "What's that got to do with Word?"
you say? Well, I want to put formatting into the mail so as to make it
look more readable. The thing is, I've never programmed anything for
Word in VBA. So, I'm starting at the beginning; I defined a variable
as a Word.Paragraph. Can I treat this like a string variable that has
formatting capabilities, or do I have to actually open Word, create a
new document and then compile it in there? if so, then I would the
following be more or less ther right way to do it in an Access module?
1) Set object variables to the Word application, Word document, and
Word paragraph
2) Create a new Word document
3) Run the routine in Access that does the analysis which puts out
paragraphs at a time. Append them to document, and set the formatting
as I'm going
4) After the content is completed and the Access routine has run its
course, create an email in the Access routine, then set the body equal
to the ActiveDocument where the Range will encompass the entire
document
5) Send the mail
6) Close the Document object while not saving
7) Quit the Word Application
I'm sorry for the absolute stupidness of this question, but I do 99%
of my work in Access, so I'm very familiar with the database model.
I've just used Word for some basic typing and not much else.
Thanks for any help or insights...
regarding entries in a database. "What's that got to do with Word?"
you say? Well, I want to put formatting into the mail so as to make it
look more readable. The thing is, I've never programmed anything for
Word in VBA. So, I'm starting at the beginning; I defined a variable
as a Word.Paragraph. Can I treat this like a string variable that has
formatting capabilities, or do I have to actually open Word, create a
new document and then compile it in there? if so, then I would the
following be more or less ther right way to do it in an Access module?
1) Set object variables to the Word application, Word document, and
Word paragraph
2) Create a new Word document
3) Run the routine in Access that does the analysis which puts out
paragraphs at a time. Append them to document, and set the formatting
as I'm going
4) After the content is completed and the Access routine has run its
course, create an email in the Access routine, then set the body equal
to the ActiveDocument where the Range will encompass the entire
document
5) Send the mail
6) Close the Document object while not saving
7) Quit the Word Application
I'm sorry for the absolute stupidness of this question, but I do 99%
of my work in Access, so I'm very familiar with the database model.
I've just used Word for some basic typing and not much else.
Thanks for any help or insights...