Consulting

Results 1 to 3 of 3

Thread: send email in active window

  1. #1

    send email in active window

    Hi,

    I hope someone can help.

    i am trying to send a email in the activewindow but i am getting errors.

    Sub SendMyOpenMailNow()
    
        Dim MyMailItem As Outlook.MailItem
        Dim myOlApp As New Outlook.Application
        If TypeName(myOlApp.ActiveWindow) = "Inspector" Then
            Set MyMailItem = myOlApp.ActiveWindow
    
            MyMailItem.Send
        End If
    End Sub
    thank you for any help

    Col

  2. #2
    VBAX Tutor Mavyak's Avatar
    Joined
    Jul 2008
    Posts
    204
    Location
    Inspector != MailItem

    Try:
    [VBA]myOlApp.ActiveWindow.CurrentItem.Send[/VBA]

  3. #3
    Mavyak,

    thank you for the help.

    this worked..

    Sub SendOpenItem()
       'works!!!!
       Dim myOlApp As New Outlook.Application
        Dim myItem As Object
        Set myItem = myOlApp.ActiveInspector.CurrentItem
        myItem.Send
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •