SendObject problem

C

Cadburys

Hi

I have a button on my form which attaches a report in pdf format to an email
.. The problem is that the email address is coming up incorrectly in Outlook
and says that it does not recognise the address.

My code is as follows:

DoCmd.SendObject acSendReport, "Confirmed", , [EmailAddress], , ,
"Booking Confirmation"

The [EmailAddress] refers to my email address field on the form which might
be (e-mail address removed) but in Outlook it comes up as
(e-mail address removed)#mailto:[email protected]#


What am I doing wrong? Thanks for any help!
 
D

Douglas J. Steele

Since EmailAddress is a hyperlink field, its value isn't what you see in the
text box. Hyperlink fields have up to three parts to them:
displaytext#address#subaddress.

Fortunately, there's a HyperlinkPart function you can use:
 
D

Douglas J. Steele

Sorry: that got sent too soon.

Since EmailAddress is a hyperlink field, its value isn't what you see in the
text box. Hyperlink fields have up to three parts to them:
displaytext#address#subaddress.

Fortunately, there's a HyperlinkPart function you can use:

DoCmd.SendObject acSendReport, "Confirmed", , _
HyperlinkPart([EmailAddress], acDisplayText) , , , _
"Booking Confirmation"
 
C

Cadburys

Thank you so much!!
--
Cheers


Douglas J. Steele said:
Sorry: that got sent too soon.

Since EmailAddress is a hyperlink field, its value isn't what you see in the
text box. Hyperlink fields have up to three parts to them:
displaytext#address#subaddress.

Fortunately, there's a HyperlinkPart function you can use:

DoCmd.SendObject acSendReport, "Confirmed", , _
HyperlinkPart([EmailAddress], acDisplayText) , , , _
"Booking Confirmation"

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


Cadburys said:
Hi

I have a button on my form which attaches a report in pdf format to an
email
. The problem is that the email address is coming up incorrectly in
Outlook
and says that it does not recognise the address.

My code is as follows:

DoCmd.SendObject acSendReport, "Confirmed", , [EmailAddress], , ,
"Booking Confirmation"

The [EmailAddress] refers to my email address field on the form which
might
be (e-mail address removed) but in Outlook it comes up as
(e-mail address removed)#mailto:[email protected]#


What am I doing wrong? Thanks for any help!


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top