How to insert .doc files automatically after specified heading name?(Word 2003)

J

Jim

Hi all,

My problem is to insert many .doc files to one .doc file.

Pseudocode looks like this:

1. Read heading
2. try to find file
3. if found insert it -> goto next heading
4. if not found -> goto next heading

I try to apply this example code.

With ActiveDocument.Content.Find
.ClearFormatting
.Style = wdStyleHeading3
Do While .Execute(FindText:="", Forward:=True, _
Format:=True) = True
With .Parent
.StartOf Unit:=wdParagraph, Extend:=wdMove
.InsertAfter "Tip: "
.Move Unit:=wdParagraph, Count:=1
End With
Loop
End With

How I can browse all heading types? This example generates always new
heading and after that inserts the word "Tip:". My target is only
insert file after heading, how to modify code?

Thank you
 

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