Home » Category » DLL & COM & ActiveX

DLL & COM & ActiveX: Word 10.0 Object Library

104| Sat, 01 Dec 2007 22:04:00 GMT| epowers66| Comments (0)
I have an application that automates MS Word. The app functions properly with Word 2000 but when run on a system with Word XP it faults.

Here is a snippet of the problem code.

Set SoapNote = New Word.Application
Set SoapDoc = SoapNote.Documents.Add(TemplateName) 'Code Faults here

With SoapNote.Selection.Find 'Code Faults Here
.ClearFormatting
.Text = SearchField(x)
.Execute Forward:=True
End With

With Clipboard
.Clear
.SetText ReplacementText(x)
SoapNote.Selection.Paste
.Clear
End With

In design Mode running the Project generates a run time
error -2147221163(80040155)

Method 'Find' of object 'Selection' failed.

I have tried creating a new object of type
(Word.Application.Selection) If I change the code
accordingly to access methods of the selection object I
get an error on the line I am trying to set the Object
Reference.

What is different in 10.0 and what should I do in my code
to accomodate these changes.

Thanks

P.S. BUG: Automation Client Receives Error Calling Word Find
Object [Q292744] This KB Article addresses a similar problem, but does not fix the issue.

Keywords & Tags: word, 10.0, object, library, dll, com, activex

URL: http://programming.itags.org/com-activex/174561/
 
«« Prev - Next »» 0 helpful answers below.

DLL & COM & ActiveX Hot Answers

DLL & COM & ActiveX New questions

DLL & COM & ActiveX Related Categories