How to create a selection at a bookmark

M

Mustapha Amrani

strbody="I confirm that I accept your invitation to participate in the
Newton Institute programme on Computational Challenges in Partial
Differential Equations during the period 19 Mar-8 Apr 2003 and that I accept
the terms and conditions in your offer letter."



wrdDoc.Bookmarks("Confirmation").Range.Text = StrToAdd



I want the title "Computational Challenges in Partial Differential
Equations" in italics.



How can I create a selection after the bookmark and use typeText? Is there a
better way than this?





Thanks
 
M

Mark Tangard

Mustapha,

Don't mess around with Selections, and especially with TypeText.
Try something like this:

Dim strbody As String, r As Word.Range
strbody = "I confirm that I accept your invitation..." '[etc]
wrdDoc.Bookmarks("Confirmation").Range.Text = strbody
With wrdDoc
Set r = .Range(Start:=.Bookmarks("Confirmation").Range.Start, _
End:=.Bookmarks("Confirmation").Range.End)
.Bookmarks("Confirmation").Range.Text = strbody
End With
r.MoveStart wdWord, 15
r.Collapse wdCollapseStart
r.MoveEnd wdWord, 6
r.Font.Italic = True
 

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