none
Yes/No msgbox for Outlook? RRS feed

  • Question

  • Sorry for such a simple question, but I can't find the answer.  I have a tips file with various types of Msgbox vba code for Excel and one for a handful of Word ones, too.  But I can't find anything simple like that for Outlook?

    I need a vba msgbox that will work in all versions of Outlook (do they change from version to version?) for Yes/No and, if possible, also the general syntax form or IF/THEN and IF/THEN/ELSE.

    Like I said, I've been searching for over an hour and ... nothing?  I'm finding all sorts of complex items related to this but nothing with just the simplest syntax.

    Thanks so much in advance!

    Tuesday, October 15, 2013 3:10 PM

Answers

All replies

  • See http://msdn.microsoft.com/en-us/library/sfw6660x(v=vs.84).aspx

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, October 15, 2013 4:13 PM
  • Hi,

    >>I need a vba msgbox that will work in all versions of Outlook (do they change from version to version?) for Yes/No and, if possible, also the general syntax form or IF/THEN and IF/THEN/ELSE.<<

    Do you just want  a VBA msgbox code?

    As far as I know, the using of msgbox method are same in all versions of Outlook. It means you can use it in Outllook as the Excel and Word.

    The simplest syntax:

     Sub main()
     MsgBox "Hollow World"
     End Sub

    Saturday, October 19, 2013 5:53 AM
  • Hi SGFan,

    Here is a sample for your reference:

    Sub YesOrNoMessageBox()
        result = MsgBox("YesOrNoMessageBox", vbYesNo)
        
        If result = vbYes Then
            Debug.Print "You selected YES"
        Else
            Debug.Print "You selected No"
        End If
    End Sub
    As Dmitry motioned, you could also get more information from MsgBox Function.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 23, 2013 2:11 AM
    Moderator