Macro for formatting layout

S

Search

Hii there ,


I have a text file with 1000 lines.
Each line consist 128 characters.

For layout reasons I should split following characters : 1, 2,
3-6,7-10,11-22,23-32,33-47,48-125,126,127,128
I should have these eleven blocks of data separated for each other for
visibilty (readability) of the data.

Can I import the textfile in word and let a macro split the datablocks in a
certain layout?
How should I do this?
I 'm not familiar with visual basic writing the code for it?


thx for any help


Gerry
 
W

Word Heretic

G'day "Search" <[email protected]>,

There's a few ways, here's one:

Sub FormatTextGerryStyle()

Dim Para as Paragraph
Dim Fiddler as Range

For each Para in ActiveDocument.Paragraphs
Set Fiddler=Para.Range
With fiddler
'Pos 1
.collapse wdcollapsestart
.move wdcharacter,1
.insertafter " "
'Pos 2
.collapse wdcollapsestart
.move wdcharacter,1
.insertafter " "
'Pos 6
.collapse wdcollapsestart
.move wdcharacter,4
.insertafter " "

etc

Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Search was spinning this yarn:
 

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