如何在word文档内的特定位置写入文本 [英] How to write a text at specific location inside the word document
问题描述
您好,
任何人都知道如何在Word文档中的特定位置插入文本。
--------------------------------------- -------------------------------------文件开始----------- -------------------------------------------------- -------------------------------
ABC
<我要添加的文字.....>
XYZ
------------------------------------------- ---------------------------------文件结束--------------- -------------------------------------------------- ---------------------------
谢谢,Parth
您可以在要插入文本的位置设置书签。
然后,您可以使用
doc.Bookmarks(" MyBookmark")。Range.Text ="我要添加的文本.... ;
其中doc是Word.Document对象,MyBookmark是书签的名称。上面的行会破坏书签;如果你想要保存它看到
http://word.mvps.org/FAQs/MacrosVBA/InsertingTextAtBookmark.htm
Hi,
Anyone knows how to insert text at specific location in Word Document.
----------------------------------------------------------------------------Document Start--------------------------------------------------------------------------------------------
ABC
<The Text I want to Add.....>
XYZ
----------------------------------------------------------------------------Document End--------------------------------------------------------------------------------------------
Thanks, Parth
You could set a bookmark at the place where you want to insert the text.
You can then use
doc.Bookmarks("MyBookmark").Range.Text = "The Text I want to Add...."
where doc is a Word.Document object, and MyBookmark the name of the bookmark. The above line will destroy the bookmark; if you want to preserve it see http://word.mvps.org/FAQs/MacrosVBA/InsertingTextAtBookmark.htm
这篇关于如何在word文档内的特定位置写入文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!