Menu

#3 .Find.Execute method

open
nobody
None
5
2006-06-18
2006-06-18
Anonymous
No

How can I realize this?

Set myRange = ActiveDocument.Content
myRange.Find.Execute FindText:="hi",
ReplaceWith:="hello", _
Replace:=wdReplaceAll

'------- try in FreeBasic ---------
dhCreateObject("Word.Application", NULL, @wdApp)
dhGetValue("%o", @wdDoc, wdApp, ".ActiveDocument")
dhGetValue("%o", @wdRange, wdDoc, ".Content")
dhCallMethod( wdRange,".Find.Execute (FindText=%s,
ReplaceWith=%s, Replace=%d)","p","zzzzz",2)

--Error---------
Function: CallMethod
Error in: InvokeArray
Error: Type mismatch: 'Execute'.Argument index:0

WBR, Ahdrew

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.