Solved

Outlook Macro No Longer Working in 2007

Posted on 2009-07-06
4
150 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

691 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