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
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