Make text in MsgBox Bold?

V

Vanessa

Is there a way to make part of your text in a MsgBox bold?
(This would really be nice for an application that I'm
developing...) - Thanks for any help!
 
P

Paul Overway

Use the function below instead of Msgbox, as follows:

fMsgBox "This is bold.@@This is not bold.",,"Box Title"




Public Function fMsgBox(Prompt As String, Optional Buttons As Integer =
vbOKOnly, _
Optional Title As Variant, Optional HelpFile As Variant, Optional Context
As Variant) As Integer
On Error Resume Next

Dim strMsgBox As String

strMsgBox = "Msgbox(" & Chr(34) & Prompt & Chr(34) & "," & Buttons

If IsMissing(Title) = False Then
strMsgBox = strMsgBox & "," & Chr(34) & Title & Chr(34)
Else
strMsgBox = strMsgBox & "," & Chr(34) & GetOption("Project Name") &
Chr(34)
End If

If IsMissing(HelpFile) = False Then
strMsgBox = strMsgBox & "," & Chr(34) & HelpFile & Chr(34)
End If

If IsMissing(Context) = False Then
strMsgBox = strMsgBox & "," & Context
End If

strMsgBox = strMsgBox & ")"

fMsgBox = Eval(strMsgBox)

End Function
 
G

Guest

Yes,

But how can you make it so that
for example the string ABC is bold only
in the following message box

MsgBox("Please call ABC on extension 900")
 
R

Rick Brandt

Yes,

But how can you make it so that
for example the string ABC is bold only
in the following message box

MsgBox("Please call ABC on extension 900")

You can't. You would have to build your own form to use instead of a
MsgBox().
 
P

Paul Overway

Not true....if you use the function provided in prior post, the text will be
bold. But with messages that are not multi-paragraph, you need to fake it
out, i.e.,

fMsgBox("Please call ABC on extension 900@@ ")
 
B

Bruce M. Thompson

Not true....if you use the function provided in prior post, the text will be
bold. But with messages that are not multi-paragraph, you need to fake it
out, i.e.,

fMsgBox("Please call ABC on extension 900@@ ")

It appears that you didn't read the OP's question.
 
R

Rick Brandt

Paul Overway said:
Yes...I did....and I provided the means to do what they asked.

I was responding to (e-mail address removed) who wanted one word
bolded in the middle of a MsgBox sentence. The OP was less specific about
what part of the MsgBox text they wanted to appear bolded. If they wanted
a bold paragraph followed by a non-bold paragraph then your suggestion fits
the bill.
 

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