![]() |
#1
|
|||
|
|||
![]()
Hi All,
I am looking for some ideas please. This is the first time I am using VB so still am very fresh here. I am working on a simple word document, where the front page is used to check boxes and based on true false values it inserts texts in bookmark fields further down the document. Managed to get all with the help of this Forum but got stuck with one step. The text I am inserting looks like below: "Title First line" What I want to do is to make word "Title" bold and leave the rest non-bold. Option Explicit Dim oRng As Range Dim oBM As Bookmark Private Sub CheckBox1_Click() If Me.CheckBox1.Value = True Then Set oRng = ActiveDocument.Bookmarks("Text1").Range oRng.Text = "Title" & Chr(10) & "First line" ActiveDocument.Bookmarks.Add "Text1", oRng With oRng.Font .Bold = True End With Else: Set oRng = ActiveDocument.Bookmarks("Text1").Range oRng.Text = "Blank" ActiveDocument.Bookmarks.Add "Text1", oRng With oRng.Font .Bold = False End With End If End Sub It could do something with selecting the range but I am unsure how. Any thoughts would be greatly appreciated. |
Tags |
bold header |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Frogoogue | Word VBA | 4 | 05-30-2022 09:15 AM |
![]() |
Burt | Word | 6 | 04-06-2019 09:09 AM |
![]() |
footer-assistance | Word | 1 | 06-29-2015 03:49 AM |
![]() |
Pluviophile | Word | 7 | 10-22-2013 10:29 AM |
![]() |
Rattykins | Word VBA | 4 | 06-27-2012 10:02 PM |