Compartir a través de


Método ListLevel.ApplyPictureBullet (Word)

Aplica el formato de viñeta de imagen a un párrafo o un intervalo de párrafos.

Sintaxis

expresión. ApplyPictureBullet( _FileName_ )

expresión requerida. Variable que representa un objeto "ListLevel".

Parameters

Nombre Obligatorio/opcional Tipo de datos Descripción
FileName Necesario String Ruta de acceso y nombre de archivo del archivo de imagen.

Ejemplo:

En este ejemplo se crea un nuevo documento con una lista y se aplica un formato de viñeta de imagen a todos los párrafos, salvo al primero y al último.

Sub ApplyPictureBulletsToParagraphs() 
 Dim docNew As Document 
 Dim rngRange As Range 
 Dim lstTemplate As ListTemplate 
 Dim intPara As Integer 
 Dim intCount As Integer 
 
 'Set the initial value of object variables 
 Set docNew = Documents.Add 
 
 'Add paragraphs to the new document, including eight list items 
 With Selection 
 .TypeText Text:="This is an introductory paragraph." 
 .TypeParagraph 
 End With 
 Do Until intPara = 8 
 With Selection 
 .TypeText Text:="This is a list item." 
 .TypeParagraph 
 End With 
 intPara = intPara + 1 
 Loop 
 Selection.TypeText Text:="This is a concluding paragraph." 
 
 'Count the total number of paragraphs in the document 
 intCount = docNew.Paragraphs.Count 
 
 'Set the range to include all paragraphs in the 
 'document except the first and the last 
 Set rngRange = docNew.Range( _ 
 Start:=ActiveDocument.Paragraphs(2).Range.Start, _ 
 End:=ActiveDocument.Paragraphs(intCount - 1).Range.End) 
 
 'Format the list template as a bullet 
 Set lstTemplate = ListGalleries(Index:=wdBulletGallery) _ 
 .ListTemplates(7) 
 
 'Format list with a picture bullet 
 lstTemplate.ListLevels(1).ApplyPictureBullet _ 
 FileName:="c:\pictures\bluebullet.gif" 
 
 'Apply the list format settings to the range 
 rngRange.ListFormat.ApplyListTemplate _ 
 ListTemplate:=lstTemplate 
End Sub

Consulte también

Objeto ListLevel

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.