471,585 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,585 software developers and data experts.

MS Word Bookmarks and Printing

I wrote a program in VC++ that generates a text file report. I would
like to get this report data into a word document that my company uses.
I could use bookmarks for reference in the document. Is there some
boiler plate code for C++ or VC++ that I could use to edit and add my
data to the bookmark locations in the MS Word doc file?

After I have updated the MS Word file I need to print it to a network
printer. Is there a easy way of printing this file?

My program is a win32 console application for automation. When it edits
and prints the MS Word documents it has to be done without displaying
the GUI for MS Word.

I am new to all of this windows stuff, any suggestions?

PS. Do you also know a way to email the MS Word document with SMTP?. I
have found a few SMTP add on's but I don't know if this is the best way
and have not installed yet.

Thanks in advance,
Grant

Feb 11 '06 #1
1 2382
TB
electrixnow sade:
I wrote a program in VC++ that generates a text file report. I would
like to get this report data into a word document that my company uses.
I could use bookmarks for reference in the document. Is there some
boiler plate code for C++ or VC++ that I could use to edit and add my
data to the bookmark locations in the MS Word doc file?

After I have updated the MS Word file I need to print it to a network
printer. Is there a easy way of printing this file?

My program is a win32 console application for automation. When it edits
and prints the MS Word documents it has to be done without displaying
the GUI for MS Word.

I am new to all of this windows stuff, any suggestions?

PS. Do you also know a way to email the MS Word document with SMTP?. I
have found a few SMTP add on's but I don't know if this is the best way
and have not installed yet.

Thanks in advance,
Grant


This can easily be achieved with COM. Very uncomplete code:
(Automation is provided by many microsoft products)

#include "Word_TLB.h"

{
Word_tlb::TCOM_Application word;
word = Word_tlb::CoApplication_::Create();
word->Documents->Open(...);
// do stuff
word->ActiveDocument->Print(...);
word->ActiveDocument->SendMail(...);
}

But you should ask in a VC++/COM newsgroup over at microsoft,
ie the microsoft.public.* branch. It's beyond Standard C++.

--
TB @ SWEDEN
Feb 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jeff Harbin | last post: by
1 post views Thread by electrixnow | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.