用delphi控制word,如何替换word中页眉文字,或者设置页眉

masong_1978 2013-06-13 03:29:39
如题,我想用delphi控制word,如何替换word中页眉文字?
...全文
353 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
随行的太阳 2013-06-16
  • 打赏
  • 举报
回复
虎子8 2013-06-15
  • 打赏
  • 举报
回复
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader ActiveDocument.AttachedTemplate.BuildingBlockEntries(" 空白").Insert Where:= _ Selection.Range, RichText:=True Selection.TypeText Text:="就这样明白吧" ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument 这是vb的转下delphi 一看就知吧
yadan_tanchfeng 2013-06-14
  • 打赏
  • 举报
回复
用Word录制个宏,参考宏里面的代码
reverzeng 2013-06-14
  • 打赏
  • 举报
回复
调用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;
masong_1978 2013-06-13
  • 打赏
  • 举报
回复
大侠们帮帮忙了

5,928

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧