Document.GetThemeNames method (Visio)
Returns a locale-specific array of names of themes contained in the document.
Syntax
expression.GetThemeNames (eType, NameArray())
expression An expression that returns a Document object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
eType | Required | VisThemeTypes | The type of the theme, an enumerated value from the VisThemeTypes enumeration. See Remarks for possible values. |
NameArray() | Required | String | Out parameter. An array of locale-specific theme names returned by the method. |
Return value
Nothing
Remarks
For the eType parameter, pass a value from the VisThemeTypes enumeration, which is declared in the Visio type library.
Constant | Value | Description |
---|---|---|
visThemeTypeColor | 1 | Color themes. |
visThemeTypeEffect | 2 | Effect themes. |
For the NameArray() out parameter, pass an empty, dimensionless array of type String. Visio returns the array filled with locale-specific names of themes contained in the document.
To get locale-independent themes in the document, use the Document.GetThemeNamesU method.
Note
Beginning with Microsoft Visio 2000, you can use both local and universal names to refer to Visio shapes, masters, documents, pages, rows, add-ons, cells, hyperlinks, styles, fonts, master shortcuts, UI objects, themes, and layers. When a user names a shape, for example, the user is specifying a local name.Beginning with Microsoft Office Visio 2003, the ShapeSheet spreadsheet displays only universal names in cell formulas and values. (In prior versions of Visio, universal names were not visible in the user interface.) As a developer, you can use universal names in a program when you don't want to change a name each time a solution is localized.
Example
The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the GetThemeNames method to get the list of locale-specific theme color and theme effect names in the active document. It prints the list in the Immediate window.
Public Sub GetThemeNames_Example()
Dim astrNames() As String
Dim strThemeName As String
Dim intArrayCounter As Integer
ActiveDocument.GetThemeNames visThemeTypeColor, astrNames
For intArrayCounter = LBound(astrNames) To UBound(astrNames)
strThemeName = astrNames(intArrayCounter)
Debug.Print strThemeName
Next
Debug.Print "-------------------------------------------"
ActiveDocument.GetThemeNames visThemeTypeEffect, astrNames
For intArrayCounter = LBound(astrNames) To UBound(astrNames)
strThemeName = astrNames(intArrayCounter)
Debug.Print strThemeName
Next
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기