J
Jim
Hi All,
I'm a newbie on VB and I need little help. I have a long .doc document
and my target is create new docs on every heading level.
For example my document looks like this:
1. General
This is general.
1.1 Cars
Here you can find cars.
1.2 Houses
Here you cand find houses.
2. Theory
This is theory.
So if I have a nice script it creates 4 files:
general.doc, cars.doc, houses.doc and theory.doc.
These files contains text between headings e.g. general.doc includes
text "This is general" and houses.doc "Here you can find houses"
I try to build a script but I found too many problems . Here is the
body of my code.
Sub create_files_from_headings()
all_Headings = ActiveDocument.GetCrossReferenceItems(wdRefTypeHeading)
For i = 1 To UBound(all_Headings)
MsgBox (myHeadings(i)) 'only for test purpose
ActiveDocument.Content.InsertAfter Text:=myHeadings(i)
Next i
End Sub
Thanks in advance !
I'm a newbie on VB and I need little help. I have a long .doc document
and my target is create new docs on every heading level.
For example my document looks like this:
1. General
This is general.
1.1 Cars
Here you can find cars.
1.2 Houses
Here you cand find houses.
2. Theory
This is theory.
So if I have a nice script it creates 4 files:
general.doc, cars.doc, houses.doc and theory.doc.
These files contains text between headings e.g. general.doc includes
text "This is general" and houses.doc "Here you can find houses"
I try to build a script but I found too many problems . Here is the
body of my code.
Sub create_files_from_headings()
all_Headings = ActiveDocument.GetCrossReferenceItems(wdRefTypeHeading)
For i = 1 To UBound(all_Headings)
MsgBox (myHeadings(i)) 'only for test purpose
ActiveDocument.Content.InsertAfter Text:=myHeadings(i)
Next i
End Sub
Thanks in advance !