none
msgbox top most RRS feed

  • Question

  • I put a password on my outlook using a MsgBox, so when i run outlook then the MsgBox apears and asks for the password before going into outlook but the MsgBox "hides" behind the "Outlook 2010 starting" window.

    Can someone please help me to either move the MsgBox or to make it "Top Most" so that you can see it asking for a password.

    Here's my code if it might help:

    Private Sub Application_Startup()

    Dim sread As String

    sread = InputBox("Please insert password", "Password")

        If sread = "12344" Then

            Else

                MsgBox "Incorrect Password!!", vbCritical, "Error"

                Application.Quit

        End If

    End Sub

    Mr.SMP

    Thursday, February 16, 2012 10:29 AM

Answers

  • In the Outlook VBA project open the ThisOutlookSession class module and put the code in there. It should run when Outlook is started, assuming you have granted permissions for macro code to run.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Mr.SMP" <=?utf-8?B?TXIuU01Q?=> wrote in message news:ac6b449a-1d9c-4666-9817-c2e24f50cc96...

    ok but where do i put the code then??


    Mr.SMP


    Ken Slovak MVP - Outlook
    Tuesday, February 21, 2012 2:46 PM
    Moderator

All replies

  • Add next parameter:

    MsgBox "Prompt", vbCritical + vbMsgBoxSetForeground, "Title"


    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    Thursday, February 16, 2012 1:10 PM
  • thanx!!!

    and same for the inputbox please??


    • Edited by Mr.SMP Thursday, February 16, 2012 1:41 PM
    Thursday, February 16, 2012 1:38 PM
  • You posted a similar question last week and I provided code for you to make sure the Inputbox control was "topmost'. Did you look at that at all?

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Mr.SMP" <=?utf-8?B?TXIuU01Q?=> wrote in message news:e59f53d5-85e9-4988-b180-2250e06d51d7...

    thanx!!!

    and same for the inputbox please??



    Ken Slovak MVP - Outlook
    Thursday, February 16, 2012 1:56 PM
    Moderator
  • Yea I did look at it, but i cant seem to get it right, i dont know much of programing. I can only do simple programmes.

    I use VB 2010 Express and MS Outlook 2010, if that might help, i dont know if the code might be slightly different to the other versions...


    Mr.SMP

    Sunday, February 19, 2012 7:42 AM
  • If you're using VB 2010 Express then you aren't using VBA code and can't use what you have to create macros. You also cannot as far as I know create an Outlook COM addin. In fact, with VB2010 Express I'm not sure why you're using InputBox, which is for VBA code.
     
    You're also using Application_Startup() which shouldn't work from VB 2010 Express, so now I'm completely confused as to what you're doing and why you're doing it the way you're trying to do it. Why not just use Outlook VBA macro code, and use the code I supplied to you? That would work with no changes.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Mr.SMP" <=?utf-8?B?TXIuU01Q?=> wrote in message news:aa27fd6e-4133-4d30-aa74-44480ef5b3cc...

    Yea I did look at it, but i cant seem to get it right, i dont know much of programing. I can only do simple programmes.

    I use VB 2010 Express and MS Outlook 2010, if that might help, i dont know if the code might be slightly different to the other versions...


    Mr.SMP


    Ken Slovak MVP - Outlook
    Monday, February 20, 2012 3:11 PM
    Moderator
  • ok but where do i put the code then??


    Mr.SMP

    Tuesday, February 21, 2012 9:37 AM
  • In the Outlook VBA project open the ThisOutlookSession class module and put the code in there. It should run when Outlook is started, assuming you have granted permissions for macro code to run.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Mr.SMP" <=?utf-8?B?TXIuU01Q?=> wrote in message news:ac6b449a-1d9c-4666-9817-c2e24f50cc96...

    ok but where do i put the code then??


    Mr.SMP


    Ken Slovak MVP - Outlook
    Tuesday, February 21, 2012 2:46 PM
    Moderator