Solved

Outlook Macro No Longer Working in 2007

Posted on 2009-07-06
4
149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:justinmoore14
ID: 24787907
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
ID: 24787999
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
ID: 31600313
That was IT !!  Thanks a bunch!  :-)
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24789896
You're welcome.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

749 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