TextFrame.BreakForwardLink 方法 (Word)

在链接存在的情况下,断开指定文本框架的前向链接。

语法

expression. BreakForwardLink

表达式是必需的。 一个代表 TextFrame 对象的变量。

备注

如果将此方法应用于图形,且该图形位于一串与图文框相链接的图形的中间位置,则会使链接断开,而形成两组链接的图形。 但所有文本都将保留在第一组链接的图形中。

示例

本示例实现的功能是:新建一个文档,在文档中添加三个前后链接的文本框,然后断开第二个文本框后面的链接。

Dim shapeTextbox1 As Shape 
Dim shapeTextbox2 As Shape 
Dim shapeTextbox3 As Shape 
 
Documents.Add 
 
Set shapeTextbox1 = ActiveDocument.Shapes.AddTextbox _ 
 (Orientation:=msoTextOrientationHorizontal, _ 
 Left:=InchesToPoints(1.5), _ 
 Top:=InchesToPoints(0.5), _ 
 Width:=InchesToPoints(1), _ 
 Height:=InchesToPoints(0.5)) 
shapeTextbox1.TextFrame.TextRange = "This is some text. " _ 
 & "This is some more text. This is even more text." 
 
Set shapeTextbox2 = ActiveDocument.Shapes.AddTextbox _ 
 (Orientation:=msoTextOrientationHorizontal, _ 
 Left:=InchesToPoints(1.5), _ 
 Top:=InchesToPoints(1.5), _ 
 Width:=InchesToPoints(1), _ 
 Height:=InchesToPoints(0.5)) 
 
Set shapeTextbox3 = ActiveDocument.Shapes.AddTextbox _ 
 (Orientation:=msoTextOrientationHorizontal, _ 
 Left:=InchesToPoints(1.5), _ 
 Top:=InchesToPoints(2.5), _ 
 Width:=InchesToPoints(1), _ 
 Height:=InchesToPoints(0.5)) 
 
shapeTextbox1.TextFrame.Next = shapeTextbox2.TextFrame 
shapeTextbox2.TextFrame.Next = shapeTextbox3.TextFrame 
MsgBox "Textboxes 1, 2, and 3 are linked." 
shapeTextbox2.TextFrame.BreakForwardLink

另请参阅

TextFrame 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。