Link to home
Create AccountLog in
Avatar of jzdojo
jzdojo

asked on

Outlook 2007 macro to create new message on Windows Vista and Windows 7

With some help from Experts-Exchange, several years ago, I created a macro for Outlook 2007 on Windows XP. The macro was used to create a toolbar button. A button was created for each e-mail account except for the default account. When one of these buttons was clicked it would create a new e-mail message and set the sending account.

Below is the code:
Sub SendUsing(intIndex As Integer)
    Dim olkAccount As Outlook.Account, _
        olkMail As Outlook.MailItem
    Set olkAccount = Application.Session.Accounts.Item(intIndex)
    Set olkMail = Application.CreateItem(olMailItem)
    With olkMail
        .SendUsingAccount = olkAccount
    End With
    olkMail.Display
    Set olkMail = Nothing
End Sub

I've tried utilizing the same code in Outlook 2007 on Windows Vista and Windows 7. When I click the button nothing happens.

Any ideas on what I need to do?

The idea is to have one button access to create a new message sent from a specifica account and eliminate the need to click the account button.
Avatar of jzdojo
jzdojo

ASKER

Update: It is now working with Windows Vista, but not Windows 7
ASKER CERTIFIED SOLUTION
Avatar of apache09
apache09
Flag of New Zealand image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of jzdojo

ASKER

It was a security issue. Thanks.
Ah Good Deal.
Gald to help