Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fax and E-Mail RTF text from form

Status
Not open for further replies.

chrissine

Programmer
Oct 10, 2000
5
CA
I am developing a small program which in the end requires the option to fax or e-mail an RTF document which is produced by the program. I want the e-mail and fax buttons to be able to open the default e-mail and/or fax program with the text from the RTF text box and the e-mail/fax number of the person which is held in a variable. [sig][/sig]
 
Use the internet controls MAPIsession and MAPImessage

Private Sub SendMessage()
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Compose
MAPIMessages1.MsgSubject = fraMinutes.Caption
MAPIMessages1.AttachmentName = Right(MyPathandFilename, 26)
MAPIMessages1.AttachmentPathName = "C:\DiarySoft\Minutes\"
MAPIMessages1.Send True
MAPISession1.SignOff
cmdEmail.Caption = "Send e-mail"
End Sub
Private Sub cmdEmail_Click()
If cmdEmail.Caption = "Logoff" Then
MAPISession1.SignOff
cmdEmail.Caption = "Send e-mail"
Exit Sub
End If

If cmdEmail.Caption = "Send e-mail" Then
MAPISession1.UserName = User
MAPISession1.Password = MyPassWord
MAPISession1.SignOn
If Err.Number <> 0 Then MsgBox &quot;Invalid signon attempt&quot;: Exit Sub
cmdEmail.Caption = &quot;Logoff&quot;
SendMessage
End If

[sig]<p>PK Odendaal<br><a href=mailto: pko@mweb.co.za> pko@mweb.co.za</a><br><a href= > </a><br> [/sig]
 
How do you attach several files?
With one attachment it's OK, but I just can't get to attach several files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top