LibreOffice 24.8 Hjälp
Visar en dialogruta som innehåller ett meddelande.
   MsgBox prompt As String [,buttons = MB_OK [,title As String]]
   response = MsgBox( prompt As String [,buttons = MB_OK [,title As String]])
prompt: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13).
title: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application.
buttons: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. buttons represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values:
| Namngiven konstant | Heltalsvärde | Definition | 
|---|---|---|
| MB_OK | 0 | Visa endast OK-knappen. | 
| MB_OKCANCEL | 1 | Visa knapparna OK och Avbryt. | 
| MB_ABORTRETRYIGNORE | 2 | Visa knapparna Avbryt, Upprepa och Ignorera. | 
| MB_YESNOCANCEL | 3 | Visa knapparna Ja, Nej och Avbryt. | 
| MB_YESNO | 4 | Visa knapparna Ja och Nej. | 
| MB_RETRYCANCEL | 5 | Visa knapparna Upprepa och Avbryt. | 
| MB_ICONSTOP | 16 | Lägg till Stoppikonen i dialogrutan. | 
| MB_ICONQUESTION | 32 | Lägg till Frågeikonen i dialogrutan. | 
| MB_ICONEXCLAMATION | 48 | Lägg till ikonen Utropstecken i dialogrutan. | 
| MB_ICONINFORMATION | 64 | Lägg till Informationsikonen i dialogrutan. | 
| 
 | 128 | Första knappen i dialogrutan som standardknapp. | 
| MB_DEFBUTTON2 | 256 | Andra knappen i dialogrutan som standardknapp. | 
| MB_DEFBUTTON3 | 512 | Tredje knappen i dialogrutan som standardknapp. | 
Sub ExampleMsgBox
 Const sText1 = "Ett oväntat fel inträffade."
 Const sText2 = "Programmet kommer dock att fortsätta köras."
 Const sText3 = "Fel"
 MsgBox(sText1 + Chr(13) + sText2,16,sText3)
 MsgBox(sText1 + Chr(13) + sText2, MB_ICONSTOP, sText3)
End Sub