A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Fax Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Will not send



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 27th 07, 11:27 PM posted to microsoft.public.outlook.fax
Russ Valentine [MVP-Outlook]
external usenet poster
 
Posts: 9,348
Default Will not send

You need to post in a programming group.

--
Russ Valentine
[MVP-Outlook]
"Robert" wrote in message
...
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



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't send attachments with outlook, I can send test email Harm Logan Outlook - General Queries 5 March 21st 07 06:51 PM
Can't send test message, mail takes a while to send. [email protected] Outlook - General Queries 0 March 7th 07 04:53 PM
Some items can't be send in outlook 2003. Even after repeatly clicking the send button. baarts Outlook - General Queries 1 August 9th 06 02:52 PM
OE6 is not launching from within IE6 on New Message, Send a Link, Send Page Edward Outlook Express 6 March 12th 06 02:14 AM
File send send Link by Email problems in IE after Thunderbird Install Woody Outlook - General Queries 0 January 8th 06 12:26 AM


All times are GMT +1. The time now is 08:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.