![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: draft, email, folder, going, redemption |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have a VB6 pgm that used to generate outlook e-mails correctly prior to
v2002. Now I need Redemption. I can generate the e-mail but it goes to the drafts folder and not directly to the Outbox. I can copy from Draft to Outbox but it is not ready to be sent and needs to be individually entered and sent. I should be able to generate e-mail directly to the Outbox. What am I doing wrong? Using Win2k and XP, Outlook 2k and 2002 - same results. The following code is a routine called for each e-mail so that there is only 1 To and no cc or bcc per e-mail. Function CreateMail(xsRecip As Variant, xsSubject As String, xsMsg As String, _ Optional xsAttachments As String) As Boolean ' Create new e-mail Dim xvRecip As Variant Dim xvAttach As Variant Dim xbResolveOK As Boolean Dim xnLen As Integer Dim oMailItem As Object Dim oMail As Object Dim myNameSpace As NameSpace Dim myFolder As Object Dim SafeItem, oItem On Error GoTo CreateMail_Err ' Get the message text. If xsMsg=Clipboard, then that is where the text is If xsMsg = "Clipboard" Then xsMsg = Clipboard.GetText End If xnLen = Len(xsMsg) + 1 Set Application = CreateObject("Outlook.Application") Set myNameSpace = Application.GetNamespace("MAPI") myNameSpace.Logon Set myFolder = myNameSpace.GetDefaultFolder(4) 'olFolderOutbox Set SafeItem = CreateObject("Redemption.SafeMailItem") Set oItem = Application.CreateItem(olMailItem) SafeItem.Item = oItem With SafeItem .Item = oItem .Recipients.Add xsRecip xbResolveOK = .Recipients.ResolveAll ' Note that the attachment must have the full file path. File name alone isn't good enough! If Not IsMissing(xsAttachments) And xsAttachments "" Then .Attachments.Add xsAttachments, olByValue, xnLen, "Enclosed file" End If .Subject = xsSubject .Body = xsMsg If xbResolveOK Then On Error GoTo 0 .Save .ExpiryTime = .CreationTime ' .Send .CopyTo myFolder Else MsgBox "Unable to resolve recipient. Please check " & xsRecip .Display End If End With CreateMail = True 'Set oMailItem = Nothing 'Set orSafeMailItem = Nothing 'Set xgolApp = Nothing ' CreateMail_End: Exit Function CreateMail_Err: CreateMail = False Resume CreateMail_End End Function |
| Ads |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Redemption emails to draft folder | simonkue | Add-ins for Outlook | 7 | June 14th 06 11:52 PM |
| Macro to Move Mail Messages from Draft folder to other folders | VBnovice | Outlook and VBA | 4 | June 14th 06 07:10 PM |
| Contents of Draft Folder Missing | ddlaz | Outlook - Installation | 1 | June 9th 06 06:50 AM |
| outlook draft folder has small pencil icon | scott | Outlook - General Queries | 3 | June 9th 06 12:40 AM |
| Draft Folder problem | Peter Brown | Outlook - General Queries | 1 | May 17th 06 07:53 AM |