H
heqian
Unregistered / Unconfirmed
GUEST, unregistred user!
var //查找替换WORD中的指定字符串
FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike,MatchKashida,MatchDiacritics,
MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace,MatchAlefHamza,MatchControl: OleVariant;
Range_start,Range_end,i,Range1:OleVariant;
Document_range:Range;
begin
FindText := Find_string;
MatchCase := False;
MatchWholeWord := True;
MatchWildcards := False;
MatchSoundsLike := False;
MatchAllWordForms := False;
Forward := True;
Wrap := wdFindContinue;
Format := False;
ReplaceWith := Replaced_string;
Replace := wdReplaceAll;
MatchKashida:= False;
MatchDiacritics:= False;
MatchAlefHamza:= False;
MatchControl:= False;
Document_range:=Word_App.ActiveDocument.Range(Range_start,Range_end);
Document_range.Find.Execute( FindText, MatchCase, MatchWholeWord,
MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward,
Wrap, Format, ReplaceWith, Replace,MatchKashida,MatchDiacritics,
MatchAlefHamza,MatchControl);
end;
我采用上面的语句实现对WORD中指定字符串的查找替换,我现在想做的是如何将
替换后的部分选种,定义书签bookmark;我想通过定义BOOKMARK来保证替换后的
部分不被修改,这样做可以吗??应该如何选中替换后的字符串,并定义书签??
FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike,MatchKashida,MatchDiacritics,
MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace,MatchAlefHamza,MatchControl: OleVariant;
Range_start,Range_end,i,Range1:OleVariant;
Document_range:Range;
begin
FindText := Find_string;
MatchCase := False;
MatchWholeWord := True;
MatchWildcards := False;
MatchSoundsLike := False;
MatchAllWordForms := False;
Forward := True;
Wrap := wdFindContinue;
Format := False;
ReplaceWith := Replaced_string;
Replace := wdReplaceAll;
MatchKashida:= False;
MatchDiacritics:= False;
MatchAlefHamza:= False;
MatchControl:= False;
Document_range:=Word_App.ActiveDocument.Range(Range_start,Range_end);
Document_range.Find.Execute( FindText, MatchCase, MatchWholeWord,
MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward,
Wrap, Format, ReplaceWith, Replace,MatchKashida,MatchDiacritics,
MatchAlefHamza,MatchControl);
end;
我采用上面的语句实现对WORD中指定字符串的查找替换,我现在想做的是如何将
替换后的部分选种,定义书签bookmark;我想通过定义BOOKMARK来保证替换后的
部分不被修改,这样做可以吗??应该如何选中替换后的字符串,并定义书签??