Using MS Word 9.0 Object Library

RobertCentollo
RobertCentollo used Ask the Experts™
on
Hi everybody,
I`m designing an application in order to fill MS word docs. I have found the "MS Word 9.0 Object Library" but I don`t know how to begin to use it. Do you know some tutorials or the basic functions? Thanks in advance
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2006
Commented:
you could try this

title : FILE: OFFAUTMN.EXE Discusses Office 97 and 2000 Automation and Provides Sample Code
source : http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q253/2/35.asp&NoWebContent=1

----------
Offautmn.exe is a self-extracting executable that contains a white paper supplemented with sample projects that provide the fundamentals for understanding how to Automate Microsoft Office 97 and Microsoft Office 2000 applications.

The white paper is designed to guide you from the ground up to through creating a variety of fully functional Automation clients. It is structured as a tutorial with a large assortment of sample code and provides tips throughout that facilitate development of your Automation clients. Exercises and sample code are presented for Microsoft Visual Basic, Microsoft C/C++, and Microsoft Foundation Classes (MFC) developers.

----------

hope this helps a bit
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
The VB code to start with would look like this:

'create a new instance of Word
dim appWord as Word.Application
set appWord = new Word.Application

'if you don't see word, look in the task manager :-)
appWord.Visible = true

'open a new documents (normal.dot template)
dim objDoc as Word.Document
set objDoc = appWord.Documents.Add

'open an existing document
set objDoc = appWord.Documents.Open("C:\data\yourfile.doc")

etc

'finally, closing all of if
set objDoc = nothing
appWord.Quit Save:=false 'or true...
set appWord = nothing

CHeers
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009

Commented:
Then, in VB use the button F2. Select Word as library, and you can browse all the objects, methods & event available...
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009

Commented:
my suggestion: Point split
Author of the Year 2009

Commented:
Moderator, my recommended disposition is:

    Split points between: bruintje and angelIII

DanRollins -- EE database cleanup volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial