Re: Formattting Bookmarks
- From: Kaykayme <Kaykayme@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 6 May 2009 12:59:02 -0700
Thanks so much Jay for your help and website link. It was very helpful.
"Jay Freedman" wrote:
The problem really isn't at the formatting step, but at the step where you.
inserted text at the bookmark. If the text is inserted properly, the
bookmark's range will cover the entire text -- no matter whether it's one
character, two characters, or the whole of War And Peace.
Use the technique shown in
http://www.word.mvps.org/FAQs/MacrosVBA/InsertingTextAtBookmark.htm.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
Kaykayme wrote:
Thanks Jay.
We tried that but if the .Bookmarks("BookmarkName").Range.Text = xx,
that is 2 characters instead of 1, only the first character is
formatted. What I have done that works is extend the the bookmark
range as follows
Dim bookend
bookend= .Bookmarks("BookmarkName").End + 2
.Bookmarks("BookmarkName").End = bookend
Then I selected the bookmark and formatted the text to red and single
underline. If there is a more efficient way of doing this I would
appreciate any help given.
Thanks!
"Jay Freedman" wrote:
Kaykayme wrote:
I am trying to format the text passed to a bookmark from a userform.
Any suggestions?
The process is exactly like formatting any other text in a document.
Assuming your macro knows the name of the bookmark, it goes
something like this...
With ActiveDocument.Bookmarks("theBookmarkName").Range
.Font.Name = "Arial"
.Font.Size = 16
.Font.Bold = True
' ...
End With
If you have some other problem, please be more specific about
exactly what you want to do, what your current code contains, and
what's happening that isn't what you want.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
- References:
- Formattting Bookmarks
- From: Kaykayme
- Re: Formattting Bookmarks
- From: Jay Freedman
- Re: Formattting Bookmarks
- From: Kaykayme
- Re: Formattting Bookmarks
- From: Jay Freedman
- Formattting Bookmarks
- Prev by Date: Re: Formattting Bookmarks
- Next by Date: Macro to select all objects->group->copy->paste in email
- Previous by thread: Re: Formattting Bookmarks
- Next by thread: Mystery I can't solve!
- Index(es):
Relevant Pages
|