none
outlook opens on the back RRS feed

  • Question

  • Hi,

    I have this very simple sub works fine but ms outlook (2010) opens on the back

    how do I bring it to the front?

           Try
                Dim Outl As Outlook.Application
                Outl = CreateObject("Outlook.Application")
                Dim omsg As Object
                omsg = Outl.CreateItem(Outlook.OlItemType.olTaskItem)

                omsg.Subject = "Do billing"
                omsg.StartDate = Me.ActiveControl.Text
                omsg.DueDate = Me.ActiveControl.Text

                omsg.Display(True)

            Catch ex As Exception
                MsgBox("Function tsb_todoadd : Error : " + Environment.NewLine + Err.Description, MsgBoxStyle.Critical, app_cia)
           Finally

    Thank you all

    • Moved by Neda Zhang Tuesday, January 3, 2017 2:08 AM Moved from vb.net
    Monday, January 2, 2017 7:59 PM

All replies

  • Hi Bre-x,

    Thank you for posting in MSDN forum.

    Since your issue is more related to outlook, I will move this thread to the more related forum for better support.

    Reference: https://social.msdn.microsoft.com/Forums/en-US/home?forum=outlookdev&filter=alltypes&sort=lastpostdesc

    Thank you for your understanding and support.

    Best Regards,

    Neda Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Neda Zhang Tuesday, January 3, 2017 4:35 AM
    Tuesday, January 3, 2017 2:07 AM
  • Hi,

    I am using VS 2010 to open outlook.

    This is not a outlook issue I believe. I should have been more precise on my description.

    Bre-x
    Tuesday, January 3, 2017 4:01 AM
  • Hi,

    Outlook has two kinds of windows: Explorer for folders and Inspector for items.

    To show Outlook Explorer, you could use

         Outl.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).Display()

               Outl.ActiveExplorer.WindowState = Outlook.OlWindowState.olNormalWindow

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 3, 2017 5:56 AM
    Moderator
  • Hello,

    You can use the SetForegroundWindow function which brings the thread that created the specified window into the foreground and activates the window.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Tuesday, January 3, 2017 5:03 PM