How can i change this in a .HTML format??

Arcadia

Registered User.
Local time
Today, 10:31
Joined
Jan 25, 2013
Messages
66
I have the following vba code to export a form in a pdf file in a E-mail and it al works fine but the emailmsg is not in HTML format is there a way to solve it because this drives me crazy..


Code:
Private Sub Command19_Click()
 
Dim mailto As String
Dim ccto As String
Dim bccto As String
mailto = ""
ccto = ""
bccto = ""
emailmsg = "Hi,” & vbNewLine & vbNewLine & “Please find the report attached"
mailsub = "Sales Report April-2014?"
On Error Resume Next
 
'acFormatpdf will export the result of query into pdf format and will add the pdf as attachment
 
DoCmd.SendObject acSendForm, “sales_detail”, acFormatPDF, mailto, ccto, bccto, mailsub, emailmsg, True
 
End With
End Sub
 
The DoCmd.SendObject has some limitation.
Link to the site where the below notes is coming from:
https://www.fmsinc.com/MicrosoftAccess/Email/SendObject.html

Notes:
Limitations of the SendObject Command

While the SendObject command is useful for sending an object or short message, it has several significant limitations:

  • Messages must be 255 characters or less
  • Messages are plain text and cannot be HTML format
  • Cannot attach multiple files (limited to one attachment)
  • Cannot attach a file on disk
  • Cannot filter the data source or report to just the data you need to send
  • Cannot specify the FROM address
  • Cannot specify settings such as priority, sensitivity, and read receipt
  • MAPI security dialog box prompts the user for each email to verify it is okay to send
  • Doesn't always work with email programs if it's not Outlook, Outlook Express, or Exchange
 
The first thing i would suggest is creating a report to be sent rather than a form, although that has no effect on the format of the email.

The only way to get HTML is to use widely available code to save the report as PDF (to a temporary file if you want) and create the email message yourself and send the item as an attachment.

Have a look at this post http://www.access-programmers.co.uk/forums/showthread.php?t=214158
 

Users who are viewing this thread

Back
Top Bottom