Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

inserting bold text after bookmark

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony - 14 Oct 2005 05:16 GMT
How I shold modify the following line of the code:

ActiveDocument.Bookmarks("Name").Range.InsertBefore "Text"

So that the "Text" will be inserted in bold ???

Thanks for advice.

Tony
Doug Robbins - 14 Oct 2005 05:21 GMT
ActiveDocument.Bookmarks("Name").Range.Font.Bold = True

Signature

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

> How I shold modify the following line of the code:
>
[quoted text clipped - 5 lines]
>
> Tony
Tony - 14 Oct 2005 07:05 GMT
It did not work, but with small modification I have it working. The code
looks like:

               ActiveDocument.Bookmarks("CompanyName").Range.InsertBefore
(.Range("D" & x).Text)
               ActiveDocument.Bookmarks("CompanyName").Select
               Selection.Font.Bold = wdToggle

Thanks for help.

Tony

> ActiveDocument.Bookmarks("Name").Range.Font.Bold = True
>
[quoted text clipped - 7 lines]
> >
> > Tony
Doug Robbins - 14 Oct 2005 21:33 GMT
It certainly works for me.

Signature

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

> It did not work, but with small modification I have it working. The code
> looks like:
[quoted text clipped - 19 lines]
>> >
>> > Tony
Al Borges - 16 Oct 2005 19:02 GMT
One thing that you may be interested in is the situation whereby you need to
make numerous items BOLD. You have to reset things. Here's a sample code:

       With .ActiveDocument.Content.Find
           .ClearFormatting
           .Text = "PAST MEDICAL HISTORY:"
           .Forward = True
           '.Replacement.Text = "PAST MEDICAL HISTORY:"
           .Replacement.Font.Bold = True
           .Execute Replace:=wdReplaceAll
       End With
Call Resetsearch
       With .ActiveDocument.Content.Find
           .Text = "FAMILY HISTORY:"
           .Forward = True
           '.Replacement.Text = "FAMILY HISTORY:"
           .Replacement.Font.Bold = True
           .Execute Replace:=wdReplaceAll
       End With
Call Resetsearch
       With .ActiveDocument.Content.Find
           .Text = "SOCIAL HISTORY:"
           .Forward = True
           '.Replacement.Text = "SOCIAL HISTORY:"
           .Replacement.Font.Bold = True
           .Execute Replace:=wdReplaceAll
       End With
Call Resetsearch
etc etc
End Sub

Sub Resetsearch()
With Selection.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Text = ""
  .Replacement.Text = ""
  .Forward = True
  .Wrap = wdFindContinue
  .Format = False
  .MatchCase = False
  .MatchWholeWord = False
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
  .Execute
End With
End Sub

Regards,
Al

> It certainly works for me.
>
[quoted text clipped - 21 lines]
>>> >
>>> > Tony

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.