1
votes

I am wondering if it is possible to insert into a Word Bookmark, from an Excel Macro specific bold characters of an String.

With the following code I am able to insert the entire string bold into the Work Bookmark, I want to insert the entire string into the bookmark with some bold characters.

String comes from an Excel cell

e.g This is the String

I want First and last Letters of the String bold

With WordDoc.Bookmarks("vbookmark2").Range
                    .InsertAfter Cells(r, 23).Text
                    .Font.Bold = True
                    '.Characters(30, 2).Font.Bold = True
                    '.Characters(38, 2).Font.Bold = True
 End With

1

1 Answers

0
votes

Let's suppose you have the Text that should be displayed in Bookmark in a Variable bmk

You can use:

bmk = "Bookmark"

With bmk

.Characters(Len(bmk), 1).Font.Bold = True
.Characters(1, 1).Font.Bold = True

End With

To bold out the 1st And the Last character. You can use this in your code.