How To Embed and Automate a Word Document with MFC (238611)
The information in this article applies to:
- Microsoft Office Word 2003
- Microsoft Word 2002
- Microsoft Word 2000
- Microsoft Word 97 for Windows
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
This article was previously published under Q238611 SUMMARY Documents that are embedded in other application documents,
using OLE embedding, can be modified by automation without double-clicking the
embedded document to activate it in "edit" or "open"' mode.
This
article demonstrates how to embed and automate a Microsoft Word 2000 document
in an MFC Single Document Interface application. The same approach works with a
Microsoft Word 97 document. The distinction is not which version of Word
created the document, but rather, which version of Word you use in the
automation process.
The difference is the use of the Word 2000 type
library instead of that of Word 97. The different files containing the two
different type libraries are MSWord9.olb for Microsoft Word 2000, and
MSWord8.olb for Word 97. The default location for either file is ...\Program
Files\Microsoft Office\Office.
(The default location for the type
library for Microsoft Word 2002 is C:\Program Files\Microsoft Office\Office10\msword.olb)
(The default location for the type library for Microsoft Office Word 2003 is
C:\Program Files\Microsoft Office\Office11\msword.olb) REFERENCES For additional information about
automating an embedded Office document, click the following article number to
view the article in the Microsoft Knowledge Base: 184663
How To Embed and Automate a Microsoft Excel Worksheet with MFC
Modification Type: | Major | Last Reviewed: | 3/23/2006 |
---|
Keywords: | kbhowto KB238611 kbAudDeveloper |
---|
|