I am working on a macro that will extract the wrong spelling in a Word file, I was able to search for a macro that can do just that, however I wanted to add a function that can also extract the heading preceding the body text.
With oRow
.Cells(1).Range.Text = oDoc.SpellingErrors(J).Information(wdActiveEndPageNumber)
.Cells(2).Range.Text = oDoc.SpellingErrors(J).Information(wdFirstCharacterLineNumber)
.Cells(3).Range.Text = oDoc.SpellingErrors(J)
.Cells(4).Range.Text = 'SHOULD CAPTURE THE HEADING
End With
*** Slide **** 2 Text
Shape: Title 1 >> Text: The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brownt fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
In the sample above, my existing macro is already extracting "brownt" because it is a wrong spelling. I need to add a line that will also capture "*** Slide **** 2 Text" because it is the heading of that paragraph.