473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Rename attachment sent via email/How does Access name attachments?

78
When I email a report via macro or vba code, the attached report is named "Fuel Quote Report.(ext)". I have no idea how this name is used. I have three seperate macros sending three seperate reports. Each macro is named after the report, which are all named differently. The subject messages are different. Yet, in each email, the attachments are all named the same. How does Access name the attachments? I even tried different formats (rtf, snp), to no avail. I also tested in a seperate database with other reports; again, the attachment is not actually named as the exact report name or macro name.

I figure there's some property I'm overlooking. Does anyone know how Access names the attachments? I've done some testing with various objects, and cannot find a common link (sent one form, and the attachment was named for the table tied to the form, tried another form, and the attachment was named for the form). Thanks.
May 9 '08 #1
4 6687
nico5038
3,080 Expert 2GB
To get the name of the file, it will need to be saved as a file and then use the sample code from:
http://support.microsoft.com/kb/161088

The attachment will be the filename (without the path).

Nic;o)
May 11 '08 #2
ADezii
8,834 Expert 8TB
When I email a report via macro or vba code, the attached report is named "Fuel Quote Report.(ext)". I have no idea how this name is used. I have three seperate macros sending three seperate reports. Each macro is named after the report, which are all named differently. The subject messages are different. Yet, in each email, the attachments are all named the same. How does Access name the attachments? I even tried different formats (rtf, snp), to no avail. I also tested in a seperate database with other reports; again, the attachment is not actually named as the exact report name or macro name.

I figure there's some property I'm overlooking. Does anyone know how Access names the attachments? I've done some testing with various objects, and cannot find a common link (sent one form, and the attachment was named for the table tied to the form, tried another form, and the attachment was named for the form). Thanks.
I figure there's some property I'm overlooking. Does anyone know how Access names the attachments?
I don't think that you are overlooking anything. To the best of my knowledge, the standard naming convention for E-Mailing Access Objects as Attachments is the Base File name plus the appropriate Extension for the Format in which it was sent, namely:
Expand|Select|Wrap|Line Numbers
  1. 'E-Mail rptEmployee as an Attachment in HTML Format produces the
  2. 'rptEmployee.HTML Attachment(s)  (1 File per Report Page)
  3. DoCmd.SendObject acSendReport, "rptEmployee", acFormatHTML, "HomerSimpson@Verizon.net", , , _
  4.                                "Requested Report", "For Viewing", True
  5.  
  6. 'E-Mail rptEmployee as an Attachment in Text Format produces the
  7. 'rptEmployee.TXT Attachment
  8. DoCmd.SendObject acSendReport, "rptEmployee", acFormatTXT, "HomerSimpson@Verizon.net", , , _
  9.                                "Requested Report", "For Viewing", True
  10.  
  11. 'E-Mail rptEmployee as an Attachment in Snapshot Format produces
  12. 'the rptEmployee.SNP Attachment
  13. DoCmd.SendObject acSendReport, "rptEmployee", acFormatSNP, "HomerSimpson@Verizon.net", , , _
  14.                                "Requested Report", "For Viewing", True
May 12 '08 #3
kpfunf
78
I'm thinking it's not the base file name, only in that I keep changing the name of the report, and it's name as an attachment stays the same. Odd. I tried to change the name of the underlying query (it seemed to be using that name), but that didn't work. Anyway, thanks for the suggestions!
May 13 '08 #4
kpfunf
78
Okay, I found it. The attachment takes the name of the caption. I had copy/pasted similar reports, and edited the guts of the report, but not the captions; hence, they all were coming out with the same name!
May 13 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: knoak | last post by:
Hi there, I've found a script at these great Google fora. a script to send emails with attachments. The script is below this message, name etc. aren't mine, but from the original post. My...
4
by: phatnugs420 | last post by:
Hi all, i've been struggling with creating a form that lets you add an attachment and the attachment is sent via email.. I was wondering if recieving attachments in an md5 form is the only way to...
2
by: Patrick C | last post by:
Hi All I am having a rather odd problem with CDOSYS attachment. My script sends out an email to potential employers with candidate resume's in attahments. the attachmentes are made dynamically...
1
by: Lelle | last post by:
Sorry for crossposting - sent to wrong group first hello ! does anyone have more information regarding this issue? http://www.systemwebmail.com/faq/2.3.aspx a.. Attachment Size Limit? ...
3
by: TomislaW | last post by:
I am sending word document with e-mail from asp.net 2.0 application. I read doc file like this:FileStream fs = System.IO.File.Open(docPath,FileMode.Open,FileAccess.Read,FileShare.Read); Then...
1
by: pixie | last post by:
Hi. Access 2003. The database stores contract information. I have a query for each person that is responsible for contracts. The query checks to see if there are reports due either this week,...
1
by: Chitu03 | last post by:
Hi I am already send a mail using Php with some attachement into it. My Problem is the attachement file is in my Database(mysql). I don't know how can i get from database and then add to my mail....
1
by: Drews | last post by:
I need to be able to send an email from within Access AND be able to attach a file sourced from OUTSIDE Access. i.e. as with outlook. I am familiar with "sendobject" and have no trouble sending...
1
by: deepaks85 | last post by:
Dear All, I want to send some data through a form with Multiple attachment in an HTML Format. I have tried it but it is not working for me. I am able to send data without attachment but with the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.