ParagraphFormat.SetListType メソッド (Publisher)

指定した ParagraphFormat オブジェクトのリストの種類を設定します。

構文

SetListType (Value, BulletText)

ParagraphFormat オブジェクトを表す変数。

パラメーター

名前 必須 / オプション データ型 説明
必須 PbListType 指定した ParagraphFormat オブジェクトのリストの種類を表します。 Microsoft Publisher タイプ ライブラリで宣言されている PbListType クラスの定数の 1 つを指定できます。
BulletText 省略可能 String 箇条書きのテキストを表す文字列。

注釈

Value が箇条書きであり、BulletText パラメーターが見つからない場合は、[箇条書きと段落番号] ダイアログ ボックスの最初の箇条書きが使用されます。

BulletText は 1 文字に制限されています。

BulletText パラメーターが指定され、Value パラメーターが pbListTypeBullet に設定されていない場合、実行時エラーが発生します。

次の使用例は、リストの種類が具体的には pbListTypeArabic 、番号付きリストであるかどうかをテストします。 ListType プロパティが pbListTypeArabic に設定されている場合、ListNumberSeparator プロパティは pbListSeparatorParenthesis に設定されます。 それ以外の場合は、 SetListType メソッドが呼び出され、 pbListTypeArabicValue パラメーターとして渡され、 ListNumberSeparator プロパティを設定できます。

Dim objParaForm As ParagraphFormat 
 
Set objParaForm = ActiveDocument.Pages(1).Shapes(1).TextFrame.TextRange.ParagraphFormat 
 
With objParaForm 
 If .ListType = pbListTypeArabic Then 
 .ListNumberSeparator = pbListSeparatorParenthesis 
 Else 
 .SetListType pbListTypeArabic 
 .ListNumberSeparator = pbListSeparatorParenthesis 
 End If 
End With 
 

この例では、リストの名前付きのテキスト フレームを含む、体系的なドキュメントの構造体を構成する方法を示します。 次の使用例は、文書にプレフィックスとして "list" という単語を使用するリストを含む TextFrame オブジェクトの名前付け規則があることを前提としています。 この例では、入れ子になったコレクションの反復処理を使用して、それぞれの各 ページShapes コレクションに各 TextFrame オブジェクトにアクセスします。 プレフィックス "list" を持つ各 TextFrame 名の ParagraphFormat オブジェクトには、ListType プロパティと ListBulletFontSize プロパティが設定されています。

Dim objPage As page 
Dim objShp As Shape 
Dim objTxtFrm As TextFrame 
 
'Iterate through all pages of th ePublication 
For Each objPage In ActiveDocument.Pages 
 'Iterate through the Shapes collection of objPage 
 For Each objShp In objPage.Shapes 
 'Find each TextFrame object 
 If objShp.Type = pbTextFrame Then 
 'If the name of the TextFrame begins with "list" 
 If InStr(1, objShp.Name, "list") <> 0 Then 
 Set objTxtFrm = objShp.TextFrame 
 With objTxtFrm 
 With .TextRange 
 With .ParagraphFormat 
 .SetListType pbListTypeBullet, "*" 
 .ListBulletFontSize = 24 
 End With 
 End With 
 End With 
 End If 
 End If 
 Next 
Next 
 

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。