'#Language "WWB-COM" ' Display or hide Topic Properties that are configured as hidden by default ' Copyright Harport Consulting 2022 Option Explicit Sub Main Dim e_Response As VbMsgBoxResult Dim m_Topic As Topic e_Response = MsgBox("Display hidden Topic Properties?", vbQuestion + vbYesNoCancel) Select Case e_Response Case vbYes, vbNo For Each m_Topic In ActiveDocument.Range(mmRangeAllTopics, True) With m_Topic.DataContainer If .DataContainerType = mmDataContainerTypeCustomProperties Then TopicSetPropertyVisibility(m_Topic) .CustomProperties.CustomPropertiesViewMode = _ IIf(e_Response = vbYes, mmCustomPropertiesViewModeAll, mmCustomPropertiesViewModeBasicOnly) End If End With Next End Select End Sub Sub TopicSetPropertyVisibility(ByVal m_Topic As Topic) ' Topic must be a custom property data container Dim m_Property As CustomProperty For Each m_Property In m_Topic.DataContainer.CustomProperties.CustomPropertyCollection m_Property.Basic = Not strEndsWith(m_Property.CustomPropertyName, "_") Next End Sub Function strEndsWith(ByVal s_Str As String, ByVal s_Suffix As String) As Boolean strEndsWith = (Right(s_Str, Len(s_Suffix)) = s_Suffix) End Function