Question Help with Access2010 via email attachment not sending.pdf /sending.dat

BHRIR

Registered User.
Local time
Today, 07:32
Joined
Aug 26, 2012
Messages
33
In response to an issue I have been reviewing regarding an email Attachment file Name and affiliation, I wrote

I did as you suggested and still I received the message "No Current Record"
What I discovered, I believe, is the Docmd.SendObject will only send the current record of the Form, Module, Report, Table, Query or NoObject based on your acSend "Selection" and the ObjectName must be specified as one the selections in the current db.
What I believe is if you put any other ObjectName in this slot, Access determines that this is not an object in the database and therefore there is no record to send. I tested this by manipulating the ObjectName several ways, even with a .pdf file
I verified the file exists with correct path as well as manipulating the report name within the VBA code of this button. You either get a message “ No Current Record” or “Invalid Use”

I took some time to examine the DoCmd.SendObject method and the code I have written. Most of it is working.
1. It sends the [ObjectType] type of object selected (acSendReport)
2. It sends the [ObjectName] (“Estimate”) - (whether open or not, just be sure to have filters)
3. It doesn’t do The [OutputFormat] as selected (acFormatPDF), it does it in .dat
Note: First time I sent object I had to use the open with selection in order to change what program would be used to open the file. (.dat files are now opened with Adobe)
I sent the Report to an associate in an email from Access using this code:
DoCmd.SendObject acSendReport, "Estimate", acFormatPDF, strToEmailAddress, strCcEmailAddress, strLastName & strTitle & strNumber & strEstDate, "Your BHR Copy of the Estimate is attached", True, False
The recipient received the Attachment as a .dat file and could not open it
4.It does correctly send [To] (strToEmailAddress)
5.It does correctly send [Cc] (strCcEmailAddress)
6.It does correctly send[Subject] (strLastName & strTitle & strNumber & strEstDate)
7.It does correctly send [MessageText] ("Your BHR Copy of the Estimate is attached")
8.It does Allow [EditMessage] = (True)
9.Not sure about [TemplateFile] = I’ve read the description of its purpose in VBA and Macro and always come back to “Only Applies to HTML”. I am not very savvy when it comes to understanding what one thing has to do with another. I can only guess this is not required because I am not sending an HTML. What I would like to confirm is that I definitely do not need to worry about a [TemplateFile] when sending the Report as a PDF Email Attachment or in some strange way it is required in order to convert the .dat file into .pdf. However, I have not found, read or been directed to anyhthing referrencing this [TemplateFile] that I undrestand.

Tests I have done and believe to be relevant:

1. DoCmd.OutputTo acOutputReport, "Estimate", acFormatPDF, [OutputFile] does send the Report to the OutputFile in .pdf format. Clearly see icon and when you click on it (in the files folder) it opens in .pdf with the FileName.pdf as you would expect.
2. DoCmd.SendObject acSendReport, "Estimate", acFormatPDF, strToEmailAddress, strCcEmailAddress, strLastName & strTitle & strNumber & strEstDate, "Your BHR Copy of the Estimate is attached", True, False sends attachment as (The Icon is not PDF) {“Collection of Numbers and Letters”}.dat to my email. Because my email has now been programmed to open .dat files in Adobe it opens in pdf; this condition may only apply to someone who has the option that prompts “Open With” and who then selects to open with the Adobe. If you don’t have a program (or knowhow to use open with) you are directed to the internet to find program that will open it.
3. I then changed the [To] (strToEmailAddress) to other associates who have verified it is being received as a .dat file and they can’t open it. (maybe they could if they knew to use open with) and that is one of main concerns I have.
4. To further test my theory and try to isolate the problem, I used the email icon in the Access External Data Ribbon which produced the same result as the code; the attachment was not .pdf it was still .dat.

My conclusion by evaluating the tests of I have done, is as follows:

Access is not outputting data to email in .pdf format even after format is requested. However, it will to a file on the computer.

Is there something I am missing in data base settings?
 
Sounds to me like this is an Outlook problem, not an Access problem.

A quick google search indicates similar problems resolved by fixing some Outlook settings as per the above link.
 
I don't use outlook to send the email. Access sends the attachment directly to my email account at msn. I don't believe I have Access set up to use outlook for email. Are you indicating that oulook is required/set up/running in order for Access to function properly in the DoCmd.SendObject method?
 
To use Docmd.sendobject you need to have a MAPI compliant email program installed and configured on your PC such as Outlook or Outlook Express (if your using Windows XP). You can't use a browser based webmail for this.
 
Windows 7 Ultimate is the version I am using - 64 bit
 
I completed the activation of Outlook today. However, I did not make it my default program. It was too scary for me to make this jump because microsoft uses a different email address than the one I use daily and I can't switch it without error. Something I will address at a later date, maybe after resolving the issue at hand.
 

Users who are viewing this thread

Back
Top Bottom