Solved

Outlook Macro No Longer Working in 2007

Posted on 2009-07-06
4
147 Views
Last Modified: 2012-05-07
Hello!

I have an Access 2003 Database that sends emails with attachments to the Drafts folder for review.  We then created a macro (in Outlook 2003) to cycle through the emails in the Drafts folder, opening each one & clicking the SEND button.

Office 2007 was installed, and the Outlook 2007 macro is now now longer working.

HELP!!!  Did the sendkeys sequence change?

Thanks!

Ronda
Sub SendAll()

'This macro sends all selected messages from the Drafts Folder,

'for emails generated from the TMA Database
 

    Dim olExplorer As Outlook.Explorer, _

        olSelection As Outlook.Selection, _

        olItem As Outlook.MailItem

    Dim x As Integer

    Set olExplorer = Application.ActiveExplorer()

    Set olSelection = olExplorer.Selection

    If olSelection.Count > 0 Then

        For x = olSelection.Count To 0 Step -1

            If x <> 0 Then

                Set olItem = olSelection.Item(x)

                olItem.Display

                SendKeys "^~"

                DoEvents

            End If

        Next

    End If

    Set olItem = Nothing

    Set olSelection = Nothing

    Set olExplorer = Nothing

End Sub

Open in new window

0
Comment
Question by:Ronda-S
  • 2
4 Comments
 
LVL 8

Expert Comment

by:justinmoore14
Comment Utility
Ronda-S, if possible could you give a few more details on what you mean (Not Working). IE is the macro not running when you open Outlook, When you manually run the Macro it does nothing, etc....

Also, from within Outlook have you tried going to Tools/Trust Center/Macro Security and made sure either the "Warnings for all macros" or "No security check for macros (Not recommended)" bubble is selected?? Hope this helps.

One last thing you said (Outlook 2007 macro is now now longer working) I take that you meant Outlook 2003??



Justin
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
Comment Utility
Hi, Ronda-S.

Outlook 2007 security isn't as restrictive as Outlook 2003 and earlier.  You could simply replace the SendKeys command with

    olItem.Send

0
 

Author Closing Comment

by:Ronda-S
Comment Utility
That was IT !!  Thanks a bunch!  :-)
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
You're welcome.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now