J
JonWayne
I am using the following snippet of code to send myself a message with
outlook 2003. The message shows up in the Outbox and then eventually
disappears, but never show up in my inbox. Anybody know why it doesnt get
sent? Also, can someone explain what is entered as the profile - the first
argument to the Logon method
Sub SendWithOutlook03()
Dim m As Outlook.MailItem, atch As Outlook.Attachment, Fldr As
Outlook.MAPIFolder, ns As Outlook.NameSpace
Dim App As Outlook.Application
Dim fso As FileSystemObject, TS As Scripting.TextStream, RecFile As
Scripting.File, WacFile As Scripting.File
Dim sBodyText$, AttachFile$
On Error Resume Next
Set App = GetObject(, "Outlook.Application")
If App Is Nothing Then Set App = CreateObject("Outlook.Application")
Set ns = App.GetNamespace("MAPI")
ns.Logon
Set Fldr = ns.GetDefaultFolder(olFolderOutbox)
Set m = Fldr.Items.Add(olMailItem)
sBodyText = CreateHTMLTable
'creates a block of html codes defining a table of values
AttachFile = "C:\Working\Access\Wayne.mdb"
With m
Set atch = .Attachments.Add(AttachFile)
.Recipients.Add ("(e-mail address removed)")
MsgBox .SenderEmailAddress & ", " & .SenderEmailType & ", " &
..SenderName 'this line comes up blank for each property, why?
.Body = sBodyText
.Subject = " WAC"
.BodyFormat = olFormatHTML
.Send
End With
End Sub
outlook 2003. The message shows up in the Outbox and then eventually
disappears, but never show up in my inbox. Anybody know why it doesnt get
sent? Also, can someone explain what is entered as the profile - the first
argument to the Logon method
Sub SendWithOutlook03()
Dim m As Outlook.MailItem, atch As Outlook.Attachment, Fldr As
Outlook.MAPIFolder, ns As Outlook.NameSpace
Dim App As Outlook.Application
Dim fso As FileSystemObject, TS As Scripting.TextStream, RecFile As
Scripting.File, WacFile As Scripting.File
Dim sBodyText$, AttachFile$
On Error Resume Next
Set App = GetObject(, "Outlook.Application")
If App Is Nothing Then Set App = CreateObject("Outlook.Application")
Set ns = App.GetNamespace("MAPI")
ns.Logon
Set Fldr = ns.GetDefaultFolder(olFolderOutbox)
Set m = Fldr.Items.Add(olMailItem)
sBodyText = CreateHTMLTable
'creates a block of html codes defining a table of values
AttachFile = "C:\Working\Access\Wayne.mdb"
With m
Set atch = .Attachments.Add(AttachFile)
.Recipients.Add ("(e-mail address removed)")
MsgBox .SenderEmailAddress & ", " & .SenderEmailType & ", " &
..SenderName 'this line comes up blank for each property, why?
.Body = sBodyText
.Subject = " WAC"
.BodyFormat = olFormatHTML
.Send
End With
End Sub