Consulting

Results 1 to 5 of 5

Thread: How to check if a Word Style exists

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    How to check if a Word Style exists

    Hi, I am trying to find if a style exists within the template in VBA so if it did exist I could call another sub.

    I can do it this way:
    Selection.Find.Style = ActiveDocument.Styles("_AG Green Highlight")
    Selection.Find.Execute
    If Selection.Find.Found = True Then
        If ActiveDocument.Bookmarks.Exists("PerfectPitch_Merged") = False Then
            Call PerfectPitchLoad
        End If
    End If
    However, I know the style always exists in the template of the document, but isn't necessarily in use, therefore I need code to check if it exists, rather than if it is used.

    Hope this makes sense and someone can help.

    Mark
    Last edited by Aussiebear; 02-27-2025 at 01:28 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •