Bold Message (1 Viewer)

Status
Not open for further replies.

NigelShaw

Registered User.
Local time
Today, 15:30
Joined
Jan 11, 2008
Messages
1,573
Hi,

here is something i found a while ago and put into a neat little routine. It allows bold text in a standard messagebox!

Code:
Public Sub BoldMsg(BoldText As String, PlainText As String, CaptionText As String)

Eval ("MsgBox ('" & BoldText & " @ " & PlainText & "@@',0,' " & CaptionText & "')")

End Sub

to use, call ( example )-

Code:
Call BoldMsg ("This is Bold", "This is Plain", "This is a caption")




thanks

Nigel
 

Attachments

  • bold.JPG
    bold.JPG
    14.7 KB · Views: 1,723

isladogs

MVP / VIP
Local time
Today, 15:30
Joined
Jan 14, 2017
Messages
18,186
Just clicked on this old post.

The following code (not mine) expands the idea further to include message box icons and more than one button. You can also include context help items though I've never done so

Code:
Public Function FormattedMsgBox(Prompt As String, Optional Buttons As VbMsgBoxStyle = vbOKOnly, _
 Optional title As String = vbNullString, Optional HelpFile As Variant, Optional Context As Variant) As VbMsgBoxResult

On Error GoTo Err_Handler
 
 'Taken from http://www.trigeminal.com/usenet/usenet015.asp
 
        FormattedMsgBox = Eval("MsgBox(""" & Prompt & _
         """, " & Buttons & ", """ & title & """)")
    
Exit_Handler:
    Exit Function

Err_Handler:
    MsgBox "Error " & Err.Number & " in FormattedMsgBox procedure : " & vbCrLf & "   - " & Err.Description
    
    Resume Exit_Handler
    
End Function

For example (here its used with a function GetLatestWebVersion):
Code:
FormattedMsgBox "Currency Exchange Rates Tracker version " & GetLatestWebVersion () & " is now available for download       " & vbCrLf & _
                    "from the Mendip Data Systems website           " & _
                    "@Click YES to close the program and download the latest version now          " & vbCrLf & _
                    "Click NO if you want to download this later          @", _
                        vbExclamation + vbYesNo, "New version available"



I've included this as one of the methods for getting users' attention in an example database
https://www.access-programmers.co.uk/forums/showthread.php?t=295342
 

Attachments

  • FormattedMsgBox.PNG
    FormattedMsgBox.PNG
    7.7 KB · Views: 1,006
Last edited:
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom