replace a text with a table

O

O.B.1.

Hello all!

Can anyone tell me how to replace a word in the document
with a table.
I've managed to find the word by using :

With objWord.ActiveWindow.Selection.Find
.ClearFormatting
.Text = "<TABLE1>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = True
'.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
objWord.ActiveWindow.Selection.Find.Execute

but now, once I've located it, I want to draw a table, or
in fact just replace the text with a table.

Any help would be nice!! Thanks in advance!
 
W

Word Heretic

G'day "O.B.1." <[email protected]>,

the selction has a range. Most add commands for internal document
objects have a range parameter for where to insert it. Use the former
for the latter.

Hello all!

Can anyone tell me how to replace a word in the document
with a table.
I've managed to find the word by using :

With objWord.ActiveWindow.Selection.Find
.ClearFormatting
.Text = "<TABLE1>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = True
'.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
objWord.ActiveWindow.Selection.Find.Execute

but now, once I've located it, I want to draw a table, or
in fact just replace the text with a table.

Any help would be nice!! Thanks in advance!

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

Replies offlist may require payment.
 

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