Re: Problem with multiple recipients

Tech-Archive recommends: Fix windows errors by optimizing your registry

mkovcin_at_gmail.com
Date: 12/23/04


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



Relevant Pages

  • Re: DocOutlook Landkarte Deutschland
    ... Informationen von Smarttools Outlook Weekly vom 11/19/25.02.2004 ... Karten und Routenplanung direkt aus Outlook aufrufen, ... ByVal Inspector As Inspector) Dim cb As CommandBar Dim mnu As ... ByVal lpOperation As String, _ ...
    (microsoft.public.de.outlook)
  • Re: KONTAKTE - KARTE ZUR ADRESSE ANZEIGEN
    ... Karten und Routenplanung direkt aus Outlook aufrufen, ... Wenn Sie einen Kontakt in Outlook anlegen, geben Sie neben dem Namen, der ... ByVal Inspector As Inspector) Dim cb As CommandBar Dim mnu As ... ByVal lpOperation As String, _ ...
    (microsoft.public.de.outlook)
  • Re: HTML Item properties vs. Regular item properties
    ... Why would Outlook record different times for the HTTP ... and the default folder? ... Dim app As Outlook.Application ... "Dmitry Streblechenko" wrote: ...
    (microsoft.public.outlook.program_vba)
  • Re: VBA shutdown error Outlook
    ... In Outlook VBA there is an intrinsic Application object. ... Dim oExpl As Outlook Explorer ... > Public myFlag As Boolean ... > Exit Sub ...
    (microsoft.public.office.developer.outlook.vba)
  • RE: How to copy the format in word document to Outlook Mail
    ... This is where I'm afraid you'll have to do your homework Sangeeta. ... Eric Legault (Outlook MVP, MCDBA, MCTS: ... Dim objOutlook As Outlook.Application ... Dim objWordDoc As Word.Document ...
    (microsoft.public.outlook.program_vba)