Get text formatted as heading 1 as document properties

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hannahhhh1056
    New Member
    • Jan 2010
    • 1

    Get text formatted as heading 1 as document properties

    Hello!
    I´m trying to create a makro that finds the text in a wddocument formatted as "heading 1" and then puts it in the document properties. I know how to get the text into doc properties but i see more problems when i try to find the text formatted as heading.
    As you see below i will have the headingtext as a string and just put in document properties! Any suggestions? Please.


    Sub SelectField()

    Dim str As String

    Selection.Find. ClearFormatting
    Selection.Find. Style = ActiveDocument. Styles(wdStyleH eading1)
    With Selection.Find
    .Text = ""
    .Replacement.Te xt = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLik e = False
    .MatchAllWordFo rms = False
    End With



    ActiveDocument. BuiltInDocument Properties(wdPr opertyTitle) = str


    End Sub
Working...