Here is a listing of socalled "vb constants" that are interesting for the messagebox:
# MsgBox Codes
vbOKOnly = 0 # OK button only (default)
vbOKCancel = 1 # OK and Cancel buttons
vbAbortRetryIgnore = 2 # Abort, Retry, and Ignore buttons
vbYesNoCancel = 3 # Yes, No, and Cancel buttons
vbYesNo = 4 # Yes and No buttons
vbRetryCancel = 5 # Retry and Cancel buttons
vbCritical = 16 # Critical message
vbQuestion = 32 # Warning query
vbExclamation = 48 # Warning message
vbInformation = 64 # Information message
vbDefaultButton1 = 0 # First button is default (default)
vbDefaultButton2 = 256 # Second button is default
vbDefaultButton3 = 512 # Third button is default
vbDefaultButton4 = 768 # Fourth button is default
vbApplicationModal = 0 # Application modal message box (default)
vbSystemModal = 4096 # System modal message box
vbMsgBoxHelpButton = 16384 # Adds Help button to the message box
VbMsgBoxSetForeground = 65536 # Specifies the message box window as the foreground window
vbMsgBoxRight = 524288 # Text is right aligned
vbMsgBoxRtlReading = 1048576 # Specifies text should appear as right-to-left reading on Hebrew and Arabic systems
I think that it will be clever to add 256 as well as 4096 because then the "No" button will be the default.
And adding 48 will display a warning triangle.
This is how the final code looks like:
Parameters are
strTagname
strHeader
iValueToSet
Code:
Dim shellobject,iUserReturnVal,shellobject_message
Set shellobject = CreateObject("WScript.Shell")
Set shellobject_message = CreateObject("WScript.Shell")
'Possible popup box variants are: 0=OK, 1=OK+Cancel, 2=Abort+Retry+Ignore, 3=Yes+No+Cancel, 4=Yes+No, 5=Retry+Ignore
iUserReturnVal=shellobject.Popup ("Set " & strTagname & " to " & CStr(iValueToSet) & "." & vbCrLf & " Are you sure ?", 10 , strHeader, 4+48+256+4096)
'Possible returnvalue variants are: 1=OK, 2=Cancel, 3=Abort, 4=Retry, 5=Ignore, 6=Yes, 7=No, -1=timeout
Select Case iUserReturnVal
Case -1 shellobject_message.Popup "Timeout, nothing done",2 ,strHeader, 4096
Case 6 SmartTags(strTagname) = iValueToSet
Case 7 shellobject_message.Popup "Aborted",2 ,strHeader, 4096
Case Else shellobject_message.Popup "Wscript.Shell popup code error." & vbCrLf & "Returnval = " & CStr(iUserReturnVal),2 ,strHeader, 4096
End Select