Word Auto Summary Option

S

stlhomeinspector

I do home inspections and use Word for my reports. I would like to create a
automatic summary page of all defects I list in my report instead of having
to copy and paste them one by one. Is it possible to have word search for a
specific "key word" then capture that canned statement and put it in a
seperate summary document automatically?

For example...

Defect -- The house needs ect ect

I want word to look for all canned statements that starts with the word
"Defect".
 
G

Graham Mayor

That would be simple enough. Does the term 'Defect' begin a paragraph? Is
the defect contained in a single paragraph. Then the following macro will
list those paragraphs in a new document.
http://www.gmayor.com/installing_macro.htm

Sub ListDefects()
Dim oDoc As Document
Dim oList As Document
Dim oRng As Range
Set oDoc = ActiveDocument
Set oList = Documents.Add
oList.Range.Text = "List of Defects" & vbCr
Dim oPara As Paragraph
For Each oPara In oDoc.Range.Paragraphs
If InStr(1, oPara.Range, _
"Defect") = 1 Then
Set oRng = oPara.Range
oRng.Start = oRng.Words(2).Start
oList.Range.InsertAfter oRng.Text
End If
Next oPara
End Sub

If not how are the defects listed and what ends the description of the
defect.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top