Create RTF file in VBA to include formatting?

D

DaveO

Howdy- I searched this group for possible answers, but couldn't find
relevant hits.

My company uses an MS Excel file to collect information about labor
elements in a proposal response. Part of this process is to generate a
printable summary of that information. Excel can do the job, but I'm
sure I can do it better if I create an RTF file in VBA and write
summary data to it, then save it as an RTF to open in Word.

I've written the code to generate the RTF file from Excel. My question
is: can I include commands in my code that instruct Word to use a
particular font, headers, footers, etc.? Is it possible to write Excel
VBA code to generate a .DOC file directly that would include
appropriate formatting?

I'm experienced with Excel VBA and have written some Word VBA code,
and I'd appreciate your thoughts- is there a site I can visit to get
smart on this in a hurry?

Thanks,
Dave O
 
J

Jean-Guy Marcil

DaveO was telling us:
DaveO nous racontait que :
Howdy- I searched this group for possible answers, but couldn't find
relevant hits.

My company uses an MS Excel file to collect information about labor
elements in a proposal response. Part of this process is to generate a
printable summary of that information. Excel can do the job, but I'm
sure I can do it better if I create an RTF file in VBA and write
summary data to it, then save it as an RTF to open in Word.

I've written the code to generate the RTF file from Excel. My question
is: can I include commands in my code that instruct Word to use a
particular font, headers, footers, etc.? Is it possible to write Excel
VBA code to generate a .DOC file directly that would include
appropriate formatting?

I'm experienced with Excel VBA and have written some Word VBA code,
and I'd appreciate your thoughts- is there a site I can visit to get
smart on this in a hurry?

I would simply create a Word template.
Then, from Excel, once the data has been generated, I would transfer it to a
document created based on that template. Then, with VBA, it would be easy to
format the document.
No need for rtf. If the final document must be in rtf format, then just save
as rtf.

All this can be done from Excel.


--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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