Right curved quotes & bold in macro

C

C''''est_moi

Hello to all:

Does anyone know how to achieve the following

(extract of my code)
RewrapBookmark "bkPrimeDefinition", Chr$(34) & "Prime Rate" & Chr$(34) & "
means, etc....." _

First "Chr$(34)" returns a left curved quote - perfect
Second "Chr&(34) also returns a left curved quote - not so perfect

1. I need a right curved quote at the end, of course. Found out HTML codes
8220/8221 but have been unsuccessful in incorporating them in macro.

2. I need "prime rate" in bold. Found out ASCII code (12 98) for bold and
(12 110) for back to normal but, again, my numerous trials produced more
problems than solutions.

Any help anyone can provide would be greatly appreciated.
 
P

Pesach Shelnitz

Since you have the Unicode numbers of the characters that you want to insert,
you can use ChrW(8820) and ChrW(8821) in your macro for the characters that
you want.

The following code will type a "Prime rate" in bold and return you to plain
text.

Sub BoldPrimeRate()
With Selection.Font
.Bold = True
End With
Selection.TypeText Text:="Prime rate"
With Selection.Font
.Bold = False
End With
End Sub
 
C

C''''est_moi

Thank you very very much Pesach (nice name by the way). This ChrW works just
fine. I wonder what the "W" stands for and why I have to use Chr$ with the 34
while using ChrW with the 8821 and while using Chr alone with the 13. Kinda
strange.

As for the second part of my request, I will have to look at that more
closely. Can I call a subroutine inbetween all that code that I inserted and
the numerous & and ChrW? I will have to run some tests since I am not yet
well versed in VBA programming. Will get back to let you know.

Again, thx.
 
B

Barry Schwarz

Thank you very very much Pesach (nice name by the way). This ChrW works just
fine. I wonder what the "W" stands for and why I have to use Chr$ with the 34
while using ChrW with the 8821 and while using Chr alone with the 13. Kinda
strange.

One handles ASCII coded bytes, the other one of the "wide" character
schemes like DBCS and Unicode.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top