BorderArtFormat オブジェクト (Publisher)
指定された図形に適用されている飾り枠の書式を表します。
注釈
飾り枠は、テキスト ボックス、図枠、四角形に適用される画像の枠です。
図形の BorderArt プロパティを使用して 、BorderArtFormat オブジェクトを取得します。
図に適用する飾り枠の種類を指定するには、 Set メソッドを使用します。
画像に適用する飾り枠の種類を指定するのに 名前 プロパティを使用することもできます。
注:
Name は BorderArt オブジェクトと BorderArtFormat オブジェクトの両方の既定のプロパティであるため、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 のサポートおよびフィードバックを参照してください。
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示