Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

outlook 2003 -2007

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I read somewhere you can create a rule that will run VBA code starting in Outlook 2002? Does this work in 2003 and I suspect 2007?
I can make a basic rule just fine, but
I want to look at emails coming in with specific words in subject. move them to a specific folder. these emails have an Excel sheet in them the same file every time. They are from 20-30 different people. I would like to write VBA code to gather information in the sheet.
I can probably do that Ok, I just need to know what Outlook is capable of

TIA


DougP
[r2d2] < I Built one
 
Unfortunately they have tightened down Outlook here, so i can no longer use any scripting, even on my own machine. However, I believe you are correct, you can have a rule run a script.


unknown
 
Ok,
I am also having troulbe opening outlook
with this code
Code:
    Select Case Err.Number
        Case 429
                ' Outlook wasn't running, start it from code
                Set oOutlookApp = CreateObject("Outlook.Application.11")
                
                bStarted = True
                Set oOutlookApp = GetObject(, "Outlook.Application.11")

I can see outlook is running after the create object line but how to I make it visible?
oOutlookApp.Visible = True ' this does not work
Error = 438 Object does not support that property or method.

also the GetObject line throws an error too.
ActiveX can't create object

I want to automate sending emails

TIA


DougP
[r2d2] < I Built one
 
this works
you must add a reference in Tools/references
Microsoft Outlook 12.0 Object Library (this is for version 2007)
Code:
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(olMailItem)


    With OutMail
        .To = "Cole, Vicki L; Orr, Lawrence D"
        .CC = "Dickinson, Keith A; Chambers, Jeffrey L; Powell, Kevin A"
        .BCC = ""
        .Subject = "Daily NRC OIT Report for " & Date
        .Display
    End With

If Outlook is open it pops up an email.
If Outlook is closed it opens outlook after quite a long time and then the email pops up.


DougP
[r2d2] < I Built one
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top