BreakForwardLink 方法

       

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

expression.BreakForwardLink

expression   必需。返回 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