473,386 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 2552
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeff Harbin | last post by:
I've got an ACCESS 2000 application that I'm developing. One of the outputs of this app will be to generate a series of 'jobs' which corresponds to a record in the database. Each record will be...
1
by: moelleni | last post by:
Hi, I made an Access 2002 Database and wanted to automate it to sent the current record to Word 2002. So readed the article "How to send the current record to Word 2000 with automation" I tried...
1
by: electrixnow | last post by:
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...
2
by: ashwanir | last post by:
Hi All, I am trying to first edit and then print a word document (saved on web server). The code works fine in debug mode, but when i deploy this to web server, then i get the following error. ...
1
by: belinda | last post by:
I have used the ff command but only get the date printout and have no clue whats wrong: 'Printing function ' - opening a Word template with bookmarks ' - read bookmarks list from template and...
1
by: kirkus84 | last post by:
I am currently trying to do a multiple record mail merge through a query via a command button on a form. The query basically displays customers who have said yes to privacy. The user inputs a date...
0
by: deboe | last post by:
I am trying to pull in some data from a database (Access) and merge the data to a Word document (basically mail merge). I got the data to fill in the bookmarks in the document but only the first...
9
by: DeZZar | last post by:
Hi all, Basically I want the data in an open form to merge with a word template and create a new document. So a user navigates to a particular records and presses a button "Produce Document"...
1
by: mrsgwen90 | last post by:
I have an access application with a vba backend and it opens a word document to enter information and then print the word document and should close it. I keep getting an error on the line...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.