Insert text into certain position in word

R

Richard

Hello:
I want to export some data from Ms project and insert these text into
special position ( Line and column ) . But i don't know how to navigate in
word. i mean i have no idea about how to mark the position where i want to
add new text.

please give me some good ideas on how to do it.
Thanks for your attention !
 
D

Doug Robbins

Insert a bookmark at the location where you want the data to appear and then
use the .Range property of the bookmark

ActiveDocument.Bookmarks("yourbookmark).Range.InsertBefore "your data"

If you have a space selected when you insert the bookmark, the data will be
inserted inside the bookmark and can then be referenced using a REF field if
necessary.

Alternatively, you can use a DOCVARIABLE field where you want the data to
appear and use

With ActiveDocument
.Variables("yourvariablename").Value = "your data""
.Range.Fields.Update
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

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