Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
OLE Automation and Mutliple Office Releases
I recently wrote a macro to create an email from Excell. It works fine on my
machine (using Office 2002). When I try to run it on on an office 2000 machine it faults out. I know it is a reference library issue, but I don't know how to handle it. Here is a sample of my code: Sub Mailto(myMessage) Dim OLF As Outlook.MAPIFolder Dim olMailItem As Outlook.MailItem Dim ToContact As Outlook.Recipient mySubject = Range("AK2") myFilename = Range("AK3") myMailTo1 = Range("AM4") 'Save Current File ActiveWorkbook.SaveCopyAs (myFilename) 'Create Email Set OLF = GetObject("", _ "Outlook.Application").GetNamespace("MAPI").GetDef aultFolder(olFolderInbox) Set olMailItem = OLF.Items.Add olMailItem.Subject = mySubject With olMailItem Set ToContact = .Recipients.Add(myMailTo1) .Body = myMessage .Attachments.Add myFilename, olByValue, , _ "Attachment" .Display End With Set ToContact = Nothing Set olMailItem = Nothing Set OLF = Nothing Set fs = CreateObject("Scripting.FileSystemObject") fs.deletefile (myFilename) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I incorporate a formula to calculate many months releases? | Excel Worksheet Functions | |||
Office automation problem | Excel Programming | |||
MS Office VBA Automation Specialist | Excel Discussion (Misc queries) | |||
asp.net Office Automation - in or out of process | Excel Programming | |||
Office automation application which will work with any version of office C#.NET | Excel Programming |