procedure TZN.Button2Click(Sender: TObject);
var
count,k:integer;
findtext, matchcase, matchwholeword, matchwildcards, matchsoundslike,
matchallwordforms, forward1, wrap, format, replacewith, replace,matchkashida,matchdiacritics,matchalefhamza,matchcontrol: olevariant;
myfile:olevariant;
begin
wordapplication1.Documents.//count:=filedirstr.Count;
findtext:= 'Been replace text';// 1. 要插入的点。
matchcase := false;
matchwholeword := true;
matchwildcards := false;
matchsoundslike := false;
matchallwordforms := false;
forward1 := true;
wrap := wdfindcontinue;
format := false;
replacewith :='dkdd'; // 2. 要插入的内容。
replace := true;
matchkashida:=false;
matchdiacritics:=false;
matchalefhamza:=false;
matchcontrol:=false; worddocument1.ConnectTo(framercontrol1.activedocument as _document);//framercontrol1 与wordapplication差不多。
worddocument1.range.find.execute(findtext, matchcase, matchwholeword,matchwildcards, matchsoundslike, matchallwordforms, forward1, wrap, format, replacewith, replace,matchkashida,matchdiacritics,matchalefhamza,matchcontrol);
上面是想实现在打开的word文件中替换对象。如果替换文字是可以的。
问题: 我想替换的对象是另一个.doc文件(些文件不被显示出来)。
var
count,k:integer;
findtext, matchcase, matchwholeword, matchwildcards, matchsoundslike,
matchallwordforms, forward1, wrap, format, replacewith, replace,matchkashida,matchdiacritics,matchalefhamza,matchcontrol: olevariant;
myfile:olevariant;
begin
wordapplication1.Documents.//count:=filedirstr.Count;
findtext:= 'Been replace text';// 1. 要插入的点。
matchcase := false;
matchwholeword := true;
matchwildcards := false;
matchsoundslike := false;
matchallwordforms := false;
forward1 := true;
wrap := wdfindcontinue;
format := false;
replacewith :='dkdd'; // 2. 要插入的内容。
replace := true;
matchkashida:=false;
matchdiacritics:=false;
matchalefhamza:=false;
matchcontrol:=false; worddocument1.ConnectTo(framercontrol1.activedocument as _document);//framercontrol1 与wordapplication差不多。
worddocument1.range.find.execute(findtext, matchcase, matchwholeword,matchwildcards, matchsoundslike, matchallwordforms, forward1, wrap, format, replacewith, replace,matchkashida,matchdiacritics,matchalefhamza,matchcontrol);
上面是想实现在打开的word文件中替换对象。如果替换文字是可以的。
问题: 我想替换的对象是另一个.doc文件(些文件不被显示出来)。
解决方案 »
- 怎样把回车的“咚咚”声去掉
- 不知道DELPHI有什么好的日历控件啊?
- 下一版本的Delphi for Win32--Delphi Spacely(Delphi 2007)屏幕截图
- 急啊,在线等。。。
- 有关于记录集定位的问题,TClientDataset,TadoQuery,都可以,解决问题就行!
- ◆◆◆如何在网吧中让其他任意一台win98电脑死机??
- string如何转化为TFieldType?
- SQL的问题
- 那位老兄有制作加密光盘的经验?高分酬谢!
- Delphi如何设置 PDF文件的打开密码
- 连接VFOXPRO的字符串该用那个?来看下我这里奇怪的现象~~~顶者有分~~
- ◆◆◆◆ 小生命降生(2) ◆◆◆◆
问题: 我想替换的对象是另一个.doc文件(此文件不被显示出来)。