Creating word outline automatically from a text file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I create a word outline file from a text file. I can format the text
file any way I want with the level information, but I couldn't find any way
to import this to Word. I have some kind of hierarchy that I want to view
using Word outline (when I can see levels and expand them ans search)
 
Apply appropriate heading styles and it will all fall into place using
Outline view. http://word.mvps.org/FAQs/Formatting/UsingOLView.htm
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Your solution is only from working within Word. My issue is that I have an
hierarchical information that I can generate a text file from. Then I want
Word to take this text file and import it as an outline. Can I do that?
Example:
Text file is (or any other format which I can programmatically generate):
1,A
2,B
2,C
1,D
2,E
3,G

Then Word needs to take this file and outline it like this:

+ A ----B
| ----C
|
+ D-----E
|-------G

(A is the parent of B and C, D is a sibling of A and a parent of E, E is a
parent of E)

Does someone know of a way to do it?
Roy.
 
Using a copy of your text file, try AutoFormat and see what happens.

Otherwise, can you do it? Yes, by writing a separate vba program that
recognizes codes you put into your text file and applies heading styles as
you designate in response to those codes. Enjoy.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Autoformat didn't help. I'll guess if I want to do it, I will take your
advice and write VBA code. Thanks for your help. (It seems like a simple
feature that I wish would be included in the product)

Roy.
 
If there are no numbers in the paragraphs other than the 1, 2, 3, etc., you
could use Find and Replace to search for 1*^p and replace with ^& formatted
with the appropriate heading level (Heading 1 for 1, Heading 2, for 2,
etc.).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Do you mean doing a regular exprerssion replace outside of word, and then
opening the text file in Word?

Roy.
 
The Replace I described would be done in Word.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
1*^p is not a valid search criteria in Word2000. I get an error that says the
the special character ^p is not valid when wildcard mode is on.

So how can I match the following, and change the heading type?

1,a
2,b
3,c

Thank you for you r help.

Roy.
 
Use ^13 instead of ^p. I forgot that * is available only when using
wildcards.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
1*^13 work to match the lines, but ^&1 doesn't place a heading, it just adds
the literal 1 to the beginning of the next line.
What is the exact string I should type in the "Replace with" text box if I
want to add heading #1 to every line that begins with 1, ?

Thanks for all your help and time.

Roy.
 
I don't see where I suggested using ^&1. What I said was, "^& formatted with
the appropriate heading level." By this I mean, type ^& in the "Replace
with" dialog. Then click Format, choose Style, and select Heading 1.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Sometimes I'm not as explicit as I should be when I'm posting in a hurry.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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

Back
Top