https://www.dropbox.com/s/3zgcudrq2nwy9 ... .dotm?dl=0
Here is what the form looks like before initialization.
I have made the Styles width parts invisible for now because that does not work. Here is what it looks like after initialization.
I have commented out a line in the initialization code that throws a type mismatch error.
Here is the initialization code:
Code: Select all
Private Sub UserForm_Initialize()
lblNavPaneSettings.Caption = "This dialog is from the Add-In " & _
ThisDocument.Name & vbCr & "stored in your Word StartUp Folder: " & vbCr & _
Application.StartupPath
cbxSetWidth.Value = ThisDocument.Variables("SetNavPaneWidth").Value
cbxShowNavPane.Value = ThisDocument.Variables("NavState").Value
cbxShowStyles.Value = ThisDocument.Variables("StylesState").Value
cmbWidth.List = Array("100", "150", "200", "250", "300", "350", "400", "450")
cmbStylesWidth.List = Array("100", "150", "200", "250", "300", "350", "400", "450")
cmbStylesWidth.Visible = False ' until I get fixed
cmbWidth.Value = ThisDocument.Variables("NavPaneWidth")
' cmbStylesWidth.Value = ThisDocument.Variables("StylesPaneWidth") ' throws error
lblWidthExplain.Caption = "Pick or type width." & vbCr & " - The default setting in Word 2019 is about 400."
lblCopyright.Caption = "Copyright " & ThisDocument.CustomDocumentProperties("Copyright") & _
" Charles Kenyon, Sun Prairie, WI, USA." & _
vbCr & "Version " & ThisDocument.CustomDocumentProperties("Version")
End Sub
However, the commands for initializing the comboboxes for the Navigation Pane and the Styles Pane are identical. In both cases, the document variable being called upon is an integer. For the combobox for the styles pane (if not commented out) I get a type mismatch error message. Eventually I hope MS will address being able to change the width of the Styles Pane in vba so I can implement the rest. In the meantime, I am curious.