Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Outlook
bcm
calendaring
contacts
fax
general
installation
interop
outlook
printing
program_addins
program_forms
program_vba
teamfolders
thirdpartyutil
  
 
date: Sat, 27 Oct 2007 17:08:19 -0400,    group: microsoft.public.outlook.fax        back       


Will not send   
I am using the following code with WinXP-Pro, and Visual Basic 6.0 SP5

The code works fine until the noted line
I have Outlook 2003 installed.

this function will attach my PDF file to the fax

Public Function SendFaxMessage(Optional AttachmentPath)
    'Send the fax via Outlook.

   Dim olookApp As Outlook.Application
   Dim olookMsg As Outlook.MailItem
   Dim olookRecipient As Outlook.Recipient
   Dim olookAttach As Outlook.Attachment

   ' create the Outlook session.
   Set olookApp = CreateObject("Outlook.Application")

   ' create the message.
   Set olookMsg = olookApp.CreateItem(olMailItem)

   With olookMsg
      ' add the To recipient(s) to the message.
      Set olookRecipient = .Recipients.Add(frmCalls.txtCalls(3).Text & "@w" 
& frmCalls.lblFaxNo.Caption) 'Get name and Fax no.
      olookRecipient.Type = olTo

      ' add the CC recipient(s) to the message.
'      Set olookRecipient = .Recipients.Add("")    'Name deleted.
'      olookRecipient.Type = olCC

      ' set the Subject, Body, and Importance of the message.
      .Subject = frmCalls.txtCalls(4).Text
      .Body = "The fax is attached as a .pdf"
      .Importance = olImportanceHigh  'High importance

      ' add attachments to the message.
      If Not IsMissing(AttachmentPath) Then
         Set olookAttach = .Attachments.Add(AttachmentPath)
      End If

      ' resolve each Recipient's name
      For Each olookRecipient In .Recipients
         olookRecipient.Resolve
         If Not olookRecipient.Resolve Then
            olookMsg.Display   ' display any names that can't be resolved
         End If
      Next
         .Send 'This is where the error occurs.
      End With

      Set olookMsg = Nothing
      Set olookApp = Nothing

End Function

-- 
Thanks in advance
bob
robert11@mountaincable.net
date: Sat, 27 Oct 2007 17:08:19 -0400   author:   Robert

Re: Will not send   
You need to post in a programming group.

-- 
Russ Valentine
[MVP-Outlook]
"Robert"  wrote in message 
news:%23wGl91NGIHA.748@TK2MSFTNGP04.phx.gbl...
>I am using the following code with WinXP-Pro, and Visual Basic 6.0 SP5
>
> The code works fine until the noted line
> I have Outlook 2003 installed.
>
> this function will attach my PDF file to the fax
>
> Public Function SendFaxMessage(Optional AttachmentPath)
>    'Send the fax via Outlook.
>
>   Dim olookApp As Outlook.Application
>   Dim olookMsg As Outlook.MailItem
>   Dim olookRecipient As Outlook.Recipient
>   Dim olookAttach As Outlook.Attachment
>
>   ' create the Outlook session.
>   Set olookApp = CreateObject("Outlook.Application")
>
>   ' create the message.
>   Set olookMsg = olookApp.CreateItem(olMailItem)
>
>   With olookMsg
>      ' add the To recipient(s) to the message.
>      Set olookRecipient = .Recipients.Add(frmCalls.txtCalls(3).Text & "@w" 
> & frmCalls.lblFaxNo.Caption) 'Get name and Fax no.
>      olookRecipient.Type = olTo
>
>      ' add the CC recipient(s) to the message.
> '      Set olookRecipient = .Recipients.Add("")    'Name deleted.
> '      olookRecipient.Type = olCC
>
>      ' set the Subject, Body, and Importance of the message.
>      .Subject = frmCalls.txtCalls(4).Text
>      .Body = "The fax is attached as a .pdf"
>      .Importance = olImportanceHigh  'High importance
>
>      ' add attachments to the message.
>      If Not IsMissing(AttachmentPath) Then
>         Set olookAttach = .Attachments.Add(AttachmentPath)
>      End If
>
>      ' resolve each Recipient's name
>      For Each olookRecipient In .Recipients
>         olookRecipient.Resolve
>         If Not olookRecipient.Resolve Then
>            olookMsg.Display   ' display any names that can't be resolved
>         End If
>      Next
>         .Send 'This is where the error occurs.
>      End With
>
>      Set olookMsg = Nothing
>      Set olookApp = Nothing
>
> End Function
>
> -- 
> Thanks in advance
> bob
> robert11@mountaincable.net
>
date: Sat, 27 Oct 2007 18:27:30 -0400   author:   Russ Valentine [MVP-Outlook]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us