用BCB打开WORD并替换的问题
从VBA里查到是下面这个函数。。
Function Execute([FindText], [MatchCase], [MatchWholeWord], [MatchWildcards], [MatchSoundsLike], [MatchAllWordForms], [Forward], [Wrap], [Format], [ReplaceWith], [Replace], [MatchKashida], [MatchDiacritics], [MatchAlefHamza], [MatchControl]) As Boolean
然后偶写成
findtext = "<G#name>";
matchcase = false;
matchwholeword = true;
matchwildcards = false;
matchsoundslike = false;
matchallwordforms = false;
forward = true;
wrap = 1 ;//wdfindcontinue
format = false;
replacewith = "i love you";
Variant start=1,end=10;//这里是为RANGE函数的参数,不过不知道什么意思,胡写
//的
wa->Documents->Open("xxx.doc");
wd->ConnectTo(wa->Documents->Item(itemIndex));
wd->Range(start,end)->Find->Execute( findtext, matchcase, matchwholeword,matchwildcards, matchsoundslike, matchallwordforms, forward,wrap, format, replacewith, replace );
然后他打开文件了,接着抱错说变量类型错误,偶不知道错在哪里了。。。。