Board index » cppbuilder » automating Word 95 and Word 97
Richard Wilso
![]() CBuilder Developer |
Sun, 16 Jun 2002 03:00:00 GMT
automating Word 95 and Word 97
Using BCB4, I have managed to automate Word 95, to paste some text in the
current document, with the commands: Variant V=Variant::CreateObject("Word.Basic"); V.Exec(Function("EditPaste")); However, since the users of the program could have either Word 95 or Word 97, I thought to also put in the equivalent command for VBA; that is, if "EditPaste" raises an exception, to attempt also V.Exec(Function("Selection.Range.Paste")); that should be the equivalent in Word 97. However, testing it on a computer with Word 97 it never works, it always generates an error. What should I do differently to automate Word 97 that I haven't done to -- Richard Wilson |