用delphi控制word,如何替换word中页眉文字,或者设置页眉 如题,我想用delphi控制word,如何替换word中页眉文字? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 调用word功能,先搜索,再替换,可参考:var FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace: OleVariant; begin FindText := '<#Name>'; MatchCase := False; MatchWholeWord := True; MatchWildcards := False; MatchSoundsLike := False; MatchAllWordForms := False; Forward := True; Wrap := wdFindContinue; Format := False; ReplaceWith := 'Delphi'; Replace := True; WordDocument.Range.Find.Execute( FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace ); end; 用Word录制个宏,参考宏里面的代码 ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader ActiveDocument.AttachedTemplate.BuildingBlockEntries(" 空白").Insert Where:= _ Selection.Range, RichText:=True Selection.TypeText Text:="就这样明白吧" ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument这是vb的转下delphi 一看就知吧 大家帮我看看这段测试代码,为什么老获取不到这个子窗口的句柄? 我在treeview1的click事件里写了内容,我怎么样在expanded的时候执行的是CLICK事件; 局域网计算机的数量 急救查询问题。 怎么样修改字段的长度 EDIT问题 各位神仙哥哥姐姐:字符串问题。 请教一下,多线程同时读数据库中的一条记录,会出现什么问题,如何解决? 最近比较烦$-( 一个关于报表的问题 新安装delphi7,发现少控件,高手支招 简单问题 关于Delphi Listview行和列的问题
var
FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike,
MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace: OleVariant;
begin
FindText := '<#Name>';
MatchCase := False;
MatchWholeWord := True;
MatchWildcards := False;
MatchSoundsLike := False;
MatchAllWordForms := False;
Forward := True;
Wrap := wdFindContinue;
Format := False;
ReplaceWith := 'Delphi';
Replace := True; WordDocument.Range.Find.Execute( FindText, MatchCase, MatchWholeWord,
MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward,
Wrap, Format, ReplaceWith, Replace ); end;
ActiveDocument.AttachedTemplate.BuildingBlockEntries(" 空白").Insert Where:= _
Selection.Range, RichText:=True
Selection.TypeText Text:="就这样明白吧"
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument这是vb的转下delphi 一看就知吧