Hi all,
I have a word document in which there is a header.
The header contents are
Procedure No. PPRSON-875
SADSDDSA ASDAERA
Prepared By: DAEDF TRTFDS Dasegfhfg
Page 2 of 3 Revision Date: 20150612
The script which I am using to get the entire content is
Sub SearchHeader()
Dim rng As Range
Dim intSecCount, intSection As Integer
Dim intHFType As Integer
intSecCount = ActiveDocument.Sections.Count
For intSection = 1 To intSecCount
With ActiveDocument.Sections(intSection)
For intHFType = 1 To 3
Set rng = ActiveDocument.Sections(1).Headers(intHFType).Range
rng.Find.Execute findtext:="Procedure No.", Forward:=True
If rng.Find.Found = True Then
Debug.Print "Match"
End If
Next intHFType
End With
Next intSection
End Sub
My requirement is this
I just want the "PPRSON-875" which is after the Procedure No : from the header text.
I have done some coding in excel but for word I am pretty new.
Can any of guys help me on this.?
Thanks to the author of the code.
Bookmarks