Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

Method ~ of Object ~ Failed. Can anyone help?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nev H - 25 Apr 2006 10:05 GMT
Hello all,

I have written an application in VB6 that opens a word document (a template)
and performs "find and replace" on data that i pass in. My application is
used by external users who log on to our network via Citrix. A few of the
users get the error message "Method ~ of Object ~ Failed" (error number
-2147023113). The bit of code that this occurs is below:

Do While wrdDoc.Content.Find.Execute( _
           FindText:="@" & strReplaceField & "@", _
           MatchCase:=False, _
           MatchWholeWord:=True, _
           ReplaceWith:=strReplacement, _
           Replace:=True)
       Loop

As fas as i know, its nothing to do with Printer settings or anything, it
just seems to be the Execute statement above. Anybody any ideas as to how i
can prevent this?

Much appreciated
Nev
Jezebel - 25 Apr 2006 13:13 GMT
You might be looking in the wrong place for the problem. That error message
comes from VB (not Word) -- most commonly you get it if you try to run the
same VB project twice simultaneously. There's nothing wrong with your code
snippet, unless your string variables contain something seriously wierd.

> Hello all,
>
[quoted text clipped - 20 lines]
> Much appreciated
> Nev
Cindy M  -WordMVP- - 27 Apr 2006 13:31 GMT
Hi =?Utf-8?B?TmV2IEg=?=,

> I have written an application in VB6 that opens a word document (a template)
> and performs "find and replace" on data that i pass in. My application is
> used by external users who log on to our network via Citrix. A few of the
> users get the error message "Method ~ of Object ~ Failed" (error number
> -2147023113). The bit of code that this occurs is below:

there's a known problem on some installations when automating FIND. See this
article
Find crashes Word automation code
http://support.microsoft.com/kb/292744/EN-US/

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.