Full Version: Mymail.attachments.add Ignoring "displayname"
UtterAccess Discussion Forums > Microsoft® Access > Access Modules
AccessRube
Hello all,

I've got a module for sending emails that works fine, with one exception; I'm attaching a few files with MyMail.Attachments.Add, which is attaching the files fine, except it's ignoring the value I pass it in "Displayname", and simply using the entire file name, so, MyMail.Attachments.Add "C:\Users\Jamie_Witte\Desktop\DSFB_EmployeeRegistrationLetter_5.2.12.docx", olByValue, 1, "Registration Instructions" is attaching a file called "DSFB_EmployeeRegistrationLetter_5.2.12.docx", instead of "Registration Instructions". After doing some googling it seems like this was in issue with earlier versions, but I couldn't find a fix for this with 2010. Any thoughts, suggestions? What am I missing?



Thanks
theDBguy
Hi,

welcome2UA.gif

Can you confirm that the mail item object you created is in Rich Text Format? Thanks.

Just my 2 cents... 2cents.gif
AccessRube
Apologies, how would I check this? I can post the entire module if that would help...

I think it's plain text, I wasn't aware I could do Rich Text.
theDBguy
Hi,

QUOTE (AccessRube @ May 21 2012, 12:39 PM) *
I think it's plain text, I wasn't aware I could do Rich Text.

If you're using something like this in your code, then it's plain text:

MyMail.Body = "Email Body Message Text Here..."

If so, then the Display Name will not work because it only works with RTF. Try going to your Outlook Email Options and select the Default Email Format to be Rich Text, then in your code, you can use something like:

MyMail.RTFBody = "Your message here..."

Just my 2 cents... 2cents.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.