Re: Problem with multiple recipients
mkovcin_at_gmail.com
Date: 12/23/04
- Next message: Christian: "Windows 2003 outgoing queue"
- Previous message: Archan Das [MSFT]: "Re: Problem with multiple recipients"
- In reply to: Archan Das [MSFT]: "Re: Problem with multiple recipients"
- Messages sorted by: [ date ] [ thread ]
Date: 23 Dec 2004 03:02:01 -0800
Thanx for reply.
VBA in Outlook 2003 does the job done.
Other problem is Outlook 2003 scripting blocking for 5 seconds.
As I see, I will have to return to Outlook 2000.
Here is the code:
Public Sub SendFax()
Dim OLApp As Outlook.Application
Dim ns As Outlook.NameSpace
Dim fSend As Outlook.MAPIFolder
Dim fSent As Outlook.MAPIFolder
Dim fError As Outlook.MAPIFolder
Dim p As ContactItem
Dim bError As Boolean
Dim i As Long
Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set OLApp = Outlook.Application
Set ns = OLApp.GetNamespace("MAPI")
bError = False
Set fSend = ns.Folders("Personal Folders").Folders("Send Fax")
Set fSent = fSend.Folders("Sent")
Set fError = fSend.Folders("Error")
On Error GoTo ErrorHandler
For i = 1 To fSend.Items.Count
Set p = fSend.Items(fSend.Items.Count)
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.To = p.FirstName & " " & p.LastName & "@" &
p.BusinessFaxNumber
myItem.Attachments.Add "D:\users\share\DESPECMULTI151204.doc"
myItem.Send
If bError Then
p.Move fError
Else
p.Move fSent
End If
bError = False
Next i
Exit Sub
ErrorHandler:
Select Case Err.Description
Case "Outlook does not recognize one or more names. "
bError = True
Resume Next
Case Else
MsgBox CStr(Err.Number) & vbCrLf & Err.Description,
vbOKOnly, "Error: " & CStr(Err.Number)
'Resume
End Select
End Sub
- Next message: Christian: "Windows 2003 outgoing queue"
- Previous message: Archan Das [MSFT]: "Re: Problem with multiple recipients"
- In reply to: Archan Das [MSFT]: "Re: Problem with multiple recipients"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|