Click to See Complete Forum and Search --> : msword8.olb and C++


Neil Turner
July 7th, 1999, 09:09 AM
Hello,

Inspite of browsing the Microsoft Office Developers Forum, MSDN etc I can find nothing on Automating Word with Visual C++. I've imported the msword8.olb type library but I can't find any documentation or examples on how to use this library of functions - there are many VB examples around the net/MSDN etc but I don't use VB and you can not always relate the VB example code to C++ easily. I'm trying to add a Report Generator to our project using Word(Office 97).

Are there any example programs (fragments even) written in Visual C++ 5.0 that anyone can point me to?

Thanks in advance.

// Just keep banging the rocks together..

Wayne Fuller
July 7th, 1999, 09:19 AM
There is a sample on the MSDN disk and maybe on the website called COMEXCEL which automates EXCEL. When I am automating programs like
this I normally first do it in VB just to make sure my methods work and then transfer that to VC++. The reason is VB is very forgiving on calling
COM functions while C++ is not. And if you use #import the C++ code very much looks like VB.

How much detail do you need in your reports, in other words are you just using Word to display words with different fonts or do you need something
from Word that only Word provides? The reason why I ask is that I have an ATL class that writes things in RTF format so you would not have to
deal with Word.

Wayne

Fabi Pantera
July 7th, 1999, 09:23 AM
The Visual Basic Help from Microsoft Word Shoul be enough for this. All you need is to see the model for the automation interface, to know the methods and its parameters. The only problem in C++ is that you don't know some ID(define as enum in Basic). Anyway you can find its value using a macro in Visual Basic.
Let me know if this helps you.
Best regards,
Faby