SendObject method

JohnPapa

Registered User.
Local time
Today, 21:28
Joined
Aug 15, 2010
Messages
1,141
I use the following code to attach report rptTemp (in .snp format) to an email message.

DoCmd.SendObject _
acSendReport, _
"rptTemp", _
acFormatSNP, , , , , "*** If you cannot view the .snp attachment download Snapshot viewer from Microsoft.com ***"


Do you know whether it is possible to copy the .snp file into a folder on my hard disk and rename the .snp file to a specific name?

Thanks,
John
 
I was going to indicate that I use A03 but forgot. I am aware of the the fact that with A07+ we can export .pdf.
 
An additional point: If using A03 the creation of the .snp file is possible in a specified folder, can this take place irrespective of the email creation?
 
Google Stephen Leban's ReportToPDF. That allows you to save a report in pdf format with a specific file name.
 
vbaInet thanks,

It seems that the above requires dynapdf.dll and StrStorage.dll. I want to use this in a commercial product (www.VisualDentist.com) and would hate to have to update 100 dentists. The software is extremely portable and to just give you an idea, the calendar was created from text boxes etc. No third party software was used.

Is there another way we can achieve the end result?

John
 
Yep, you can use the Name statement -->
Code:
Name "[COLOR=Red]Path to Old file[/COLOR]" As "[COLOR=Red]Path to New file name[/COLOR]"
But if you want to send the new file you will need to use a different method of e-mailing items which is more involving.
 
vbaInet, I don't know if I made it clear that as a compromise I am happy storing the .snp file. Do we know where the .snp file is stored so that I can rename its path? The .snp file appears as an attachment in the email that was created using

DoCmd.SendObject _
acSendReport,

At this point in time I just want to save the .snp file on the hard disk in a selected folder.
 
Got you now JohnPapa.

You can use the OutputTo command:
Code:
DoCmd.OutputTo acOutputReport, "Report Name", acFormatSNP, "[COLOR=Red]Path to file[/COLOR]", , , , acExportQualityPrint
As you can see, the red bit indicates that you can save the snapshot with a file name of your choice.
 
vbaInet many thanks, a couple of isuues came up.
1) When I compile it does not like "acExportQualityPrint"
2) I removed acExportQualityPrint and used

DoCmd.OutputTo acOutputReport, "rptRootCanalTreatmentTemp", acFormatSNP, "c:\junk"

It comes back with Run-time error 2024 The report snapshot was not created because you don't have enough free disk space for temporary work files.

Any ideas?
John
 
long term, i would have thought it easier for you to issue a version upgrade to generate pdfs, together with the dlls, than to get users to find and install a snapshot viewer. It's quite hard to find the snapshot viewer in my experience.

the dlls just sit in currentproject path - they dont have to go in a windows folder.

you need to send them an upgrade, anyway, don't you?
 
vbaInet many thanks, it works fine.

gemma-the-husky thanks for your comments. Please note,
1) Long term I will upgrade to A10 which supports pdf.
2) I was surprised as well, but the snapshot viewer is readily available. The .snp file is sent daily by endodontists to the referring dentist and the only time there was a problem was with one guy who was not running windows (Apple). One case in perhaps 100.
3) The upgrade is just the front end mde, which is copied over the previous mde. I had a look at the code for the snp to pdf. It is not trivial to say the least and it may not be a good idea to add any complexity unecessarily. What if there is a problem at some point with one of the future Windows releases?
 

Users who are viewing this thread

Back
Top Bottom