Posts

Showing posts from February 3, 2019

Finding a “Heading” Style in a Word Document

Image
1 I have a Word macro that allows to put his/her cursor anywhere in a Word document and it finds and saves the Heading 1, Heading 2 and Heading 3 text that is above the text selected by the user in order capture the chapter, section and sub-section that is associated with any sentence in the document. I am currently using the code below which moves up the document line-by-line until it finds a style that contains "Heading x". When I have completed this task I move down the number of lines that I moved up to get to Heading 1, which may be many pages. As you can imagine this is awkward, takes a long time (sometimes 60+ seconds) and is visually disturbing. The code below is that subroutine that identifies the heading. Dim str_heading_txt, hdgn_STYLE As String Dim SELECTION_PG_NO as Integer ...
UXPu,RWVMOm s5E6WXV35b2uL7wMEr,l811J0eQ Y XS9AczZ2Ud0PYZ8UcuYPvlD,kAPAJr1 K,tlm,WE55,ILC,O34J G,hc,zN,HlWwm9X