Re: Formattting Bookmarks



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.



.



Relevant Pages

  • Re: Formattting Bookmarks
    ... character, two characters, or the whole of War And Peace. ... What I have done that works is extend the the bookmark ... "Jay Freedman" wrote: ... The process is exactly like formatting any other text in a document. ...
    (microsoft.public.word.vba.general)
  • Re: Bookmark with overwrite function?
    ... >bookmarkand next column of text printed with an underline character. ... >>> text length between the bookmark and the data replacing the bookmark. ... and separate the placeholder from that text with a tab character. ... >> Jay Freedman ...
    (microsoft.public.word.vba.general)
  • Re: summing a column of values from dropdown boxes
    ... Jay Freedman wrote: ... allowed to edit this region because document protection is in effect." ... So the macro has to unprotect the form, insert the text, and reprotect ... For an explanation of why I had to re-add the bookmark, ...
    (microsoft.public.word.tables)
  • Re: summing a column of values from dropdown boxes
    ... Jay Freedman wrote: ... allowed to edit this region because document protection is in effect." ... So the macro has to unprotect the form, insert the text, and reprotect ... For an explanation of why I had to re-add the bookmark, ...
    (microsoft.public.word.tables)
  • Re: INDEX of BOOKMARKS
    ... "Jay Freedman" wrote: ... When the macro is run, the list of bookmarks is displayed perfectly ... but their coding is for a hyperlink (as per line ... For example the code for a bookmark looks like this: ...
    (microsoft.public.word.docmanagement)