Sub AutoOpen()
'
' AutoOpen Macro
ActiveWindow.DocumentMap = True
'The following code snippet does NOT work, any help would be appreciated
Selection.Style = ActiveDocument.Styles("Heading 1")
End Sub
Sub AutoOpen()
'
' AutoOpen Macro
ActiveWindow.DocumentMap = True
'The following code snippet does NOT work, any help would be appreciated
Selection.Style = ActiveDocument.Styles("Heading 1")
End Sub
If you want to select the first instance of the style in a document, if present, then
Sub AutoOpen()Dim orng As Range Set orng = ActiveDocument.Range With orng.Find .Style = "Heading 1" Do While .Execute orng.Collapse 1 orng.Select Exit Do Loop End With Set orng = Nothing End Sub
Graham Mayor - MS MVP (Word) 2002-2019
Visit my web site for more programming tips and ready made processes
http://www.gmayor.com
Hopefully, this will clarify my question:
I want upon opening a document with various Styles in a doc to show in the Navigation Pane, the various Styles 1,2,3, and so on Collapsed
I have Googled and Bing for a solution previous to my question; but, alas, I cannot find a solution
Thank you