Log in

View Full Version : Sleeper: VBA to get Section Headding name from word document



usrname_aj
12-29-2011, 02:59 PM
I know how to extract comments from word document using VBA but I am not able to get section heading name under which a comment is enterd.

Here is code to extract comment ...


Dim oDoc As Word.Document
Dim objComment As Word.Comment
Dim oCommentedTextSentence as String
Set oDoc = oWordApp.Documents.Open(“c:\samplefil1.doc”, , True)
Set objComment = oDoc.Comments
'Refer the Comment Object
objComment.Reference.Select
'Extract the comment and display
oCommentedTextSentence = objComment.Reference.Sentences.Item(1).Text
msgbox (oCommentedTextSentence)


Any help in this regard is much appritiated.

fumei
01-06-2012, 08:43 PM
section heading name ???????

Sections do not have names. Nor do headings.