How to modify the *doc document?

T

Togetherwith

Hi, everybody,

I am newuser of VBA in application. I have to finish a urgent thing t
modify some character in some *doc document. the document is lik
these:

1 3 1000 25 45 1
1 4 2000 35 50 2
1 5 1000 15 25 3
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . n

In the document, this last column have some rules, such as 1,2,3...,n
Now I want to modify the document. For instance, if I want to add a ro
between row 2nd and 3rd:

1 4 1000 5 5 2

How should I write the code?

I know it is not nice for me to ask such question. But it is really
urgent task for me to finish. I have no much time on checking th
different properties of word.
Any input is highly appreciated
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

That's not really enough to go on. Simplistically

ActiveDocument.Parapraphs(3).Range.InsertBefore "1 4 1000 5 5 2" & vbCr

will do just what you have said, but I suspect that there is more to it than
that

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
T

Togetherwith

Sorry, I may not explain the question clearly.

My problem is that I should modify some number of the document, whic
is some input to a simulate software.

For example,
In line 8, column 31, I want to modify the data to 1, 2,3,4,5
In line 12, column 25, I want to modify the data to -1,0,1,2,3
In line 16, column 28, I want to modify the data to 2,4,6,20
In line 36, column 5, I want to modify the data to 10, 20, 30, 40
In line 50, column 17, I want to modify the data to 1, 2,3,4,5

I want to save any change in different files. So the number of chang
is 5*5*4*4*5=2000. If I do it by hand, it will take much time. So I a
looking for that some loop statement can do the job
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Sorry, but that does not in any way make it any clearer. If there is any
logic there, it comletely eludes me.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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