Hello everybody,
I would greatly appreciate any advice or better still some code that would extract certain headings and paragraphs from a document and place them in a new document.
After numerous attempts at recording macros (my current skill level regarding vba) and trying to stitch them together, I’ve just about given up. I’m not even sure if this task can be achieved.
To be as short and precise as possible, I would like to achieve the following goal:
Search the document for paragraphs/sentences, which end with (shortcoming)., (observation). or (finding)., select and copy them to a new file along with their associated headings.
Example:
Heading 6.1 Criterion A.1 (copy to new document)
Sentence XXXXXXXXXXXXXXXXXXXXXXXXXXX. skip
Paragraph XXXXXXXXXXXXXXXXXXXXXXXXXXX. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. skip
Paragraph XXXXXXXXXXXXXXXXXXXXXXXXXXX. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ZZZZZZZZZZZZZZZZZZZZZZZZZ (shortcoming). (Copy to new document)
Paragraph XXXXXXXXXXXXXXXXXXXXXXXXXXX. XXXXXXXXXXXXXXXXXXXXXXXXXX. ZZZZZZZZZZZZZZZZZZZZZZZ (observation). (Copy to new document)
Sentence XXXXXXXXXXXXXXXXXXXXXXXXXXX (finding). (Copy to new document)
Heading 6.1 Criterion A.2 (copy to new document)
XXXXXXXXXXXXXXXXXXXXXXXXXXX. skip
XXXXXXXXXXXXXXXXXXXXXXXXXXX. skip
XXXXXXXXXXXXXXXXXXXXXXXXXXX (shortcoming). (Copy to new document)
XXXXXXXXXXXXXXXXXXXXXXXXXXX (observation). (Copy to new document)
XXXXXXXXXXXXXXXXXXXXXXXXXXX (finding). (Copy to new document)
Not all headings in the document contain text with findings, observations or shortcomings. I can’t think how it is possible to link the headings and their associated shortcomings, observations and findings.
Any assistance would be a real relief to me.
Kind regards,
EMSA