The information in this article applies to:
SUMMARY
Object linking and embedding (OLE) Automation is a Windows protocol
that allows an application to share data or control another
application. Word for Windows provides other applications with an
object called "Basic". Using this object, other applications can send
WordBasic instructions to Word for Windows.
Visual Basic 3.0 ExampleTo control Word for Windows from a Visual Basic application, you need to first declare a variable of type Object. For example:
Next, you need to create the "Basic" object and assign it to the object
variable. For example:
The above statement makes the "Basic" object in Word available to
Visual Basic for OLE Automation. If Word for Windows is not running,
OLE Automation will attempt to start the application using the
information found in the Windows registration file (REG.DAT).
The following Visual Basic example opens a new Word document, changes the formatting at the insertion point to Arial 22 pt bold and inserts the text "Hello World":
The following Excel 5.0 example, opens a new Word document, changes
the formatting at the insertion point to Arial, 22 pt, bold and
inserts the text "Hello World".
REFERENCES
"Microsoft Word Developer's Kit," pages 174-182 Additional query words: 6.0 ole automation word basic word6 winword object container server
Keywords : kbole |
Last Reviewed: October 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |