共用方式為


Publisher) (BorderArtFormat 物件

代表套用到指定圖案之框線藝術師的格式。

註解

框線藝術師是可套用到文字方塊、圖片框或矩形的圖片框線。

使用圖案的 BorderArt 屬性可傳回 BorderArtFormat 物件。

使用 Set 方法可指定您要套用到圖片的框線藝術師類型。

您也可以使用 Name 屬性來指定您想要的框線藝術師的類型套用至圖片。

注意事項

由於 NameBorderArtBorderArtFormat 物件的預設屬性,因此您不需要在設定 BorderArt 類型時明確陳述。 語句 Shape.BorderArtFormat = Document.BorderArts(1) 相當於 Shape.BorderArtFormat.Name = Document.BorderArts(1).Name

使用 Delete 方法可從圖片中移除框線藝術師。

範例

下列範例傳回使用中出版物首頁上之第一個圖案的框線藝術師,並在訊息方塊中顯示框線藝術師的名稱。

Dim bdaTemp As BorderArtFormat 
 
Set bdaTemp = ActiveDocument.Pages(1).Shapes(1).BorderArt 
MsgBox "BorderArt name is: " &bdaTemp.Name

下列範例測試使用中文件之每個頁面的每個圖案上是否都有框線藝術師。 將所有找到的框線藝術師設定為相同的類型。

Sub SetBorderArt() 
Dim anyPage As Page 
Dim anyShape As Shape 
Dim strBorderArtName As String 
 
strBorderArtName = Document.BorderArts(1).Name 
 
For Each anyPage in ActiveDocument.Pages 
For Each anyShape in anyPage.Shapes 
With anyShape.BorderArt 
If .Exists = True Then 
.Set(strBorderArtName) 
End If 
End With 
Next anyShape 
Next anyPage 
End Sub

下列範例會使用 Name 屬性,將檔中的所有 BorderArt 設定為相同的類型。

Sub SetBorderArtByName() 
Dim anyPage As Page 
Dim anyShape As Shape 
Dim strBorderArtName As String 
 
strBorderArtName = Document.BorderArts(1).Name 
 
For Each anyPage in ActiveDocument.Pages 
For Each anyShape in anyPage.Shapes 
With anyShape.BorderArt 
If .Exists = True Then 
.Name = strBorderArtName 
End If 
End With 
Next anyShape 
Next anyPage 
End Sub

下列範例會在使用中文件每一頁的每個圖案上,測試是否存在框線藝術師。 如果框線藝術師存在,則會將其刪除。

Sub DeleteBorderArt() 
Dim anyPage As Page 
Dim anyShape As Shape 
 
For Each anyPage in ActiveDocument.Pages 
For Each anyShape in anyPage.Shapes 
With anyShape.BorderArt 
If .Exists = True Then 
.Delete 
End If 
End With 
Next anyShape 
Next anyPage 
End Sub

方法

屬性

另請參閱

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應