Classe ChartCategory - la catégorie d'un type de graphique (Word VBA)
La classe ChartCategory représente toutes les catégories de graphique dans le document, si visibles (non filtré) ou non. Pour utiliser une variable de classe ChartCategory, elle doit d'abord être instanciée, par exemple
Dim chrc as ChartCategory
Set chrc = ActiveDocument.Background.Chart.ChartGroups(1).CategoryCollection(Index:=1)
For Each
Voici un exemple de traitement des éléments ChartCategory dans une collection
Dim chrcCategoryCollection As ChartCategory
For Each chrcCategoryCollection In ActiveDocument.Background.Chart.ChartGroups(1).CategoryCollection()
Next chrcCategoryCollection
IsFiltered
Cette propriété renvoie ou définit un type Boolean qui détermine si la catégorie de graphique spécifiée est filtrée à partir du graphique.
ActiveDocument.Background.Chart.ChartGroups(1).CategoryCollection(1).IsFiltered = True
Name
Cette propriété renvoie ou définit une chaîne qui représente le nom d’une catégorie de graphique.
Dim strName As String
strName = ActiveDocument.Background.Chart.ChartGroups(1).CategoryCollection(1).Name