why in the 'inbox' folder????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
i have the following code that I use to send an email from an access
database through VBA.
What happens is that the method .SAVE seems to save the email message in the
inbox folder (which is the default one, I assume).
I want to have the message in the outbox folder or at least in the draft one.
How can I manage this?

thanks!!
here is the code:

Private Sub INVIO_Click()

Dim objol As Outlook.Application
Set objol = New Outlook.Application
Dim messaggio As Object
With objol
Set messaggio = .CreateItem(olMailItem)
End With
With messaggio
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "SELECT TOP 1 nameback,backupdate FROM u_users ORDER BY
u_users.backupdate DESC", CurrentProject.Connection, adOpenStatic,
adLockReadOnly
.Attachments.Add CurrentProject.Path & "\archivio_backup\" & rst.Fields(0)
rst.CLOSE
Set rst = Nothing
.Attachments.Add CurrentProject.Path & "\backup.zip"
.To = "(e-mail address removed)"
.Subject = "Invio delle tabelle del database da: " & CurrentUser() & "
alle " & Now()
messaggio.Save
End With

Exit Sub
 
After the line

Set objol = New Outlook.Application

add

set NS = objol.GetNamespace("MAPI")
NS.Logon

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Outlook delays logging to MAPI until the very last moment. The fact that a
message is created in the Inbox folder rather than Drafts is an indication
of that.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Uh?!
I barely understand what you said...but It works that's more then enough!!!

Thank you
 
Back
Top