hyperlink in e-mail message.

geralf

Registered User.
Local time
Today, 18:00
Joined
Nov 15, 2002
Messages
212
I'm sending an e-mail attacment of an Access report in Snapshot format. The customers receiving the reports may not have this installed or may not even have ms office at all. I,ve found a link where it can be downloaded. So in the e-mail message- I'd like to insert this link. How can I do this?

Thanks in advance.
 
Does the link change or will it be the same link?

What is your current method of sending the attachment? code?macro? manual?

Regards

Andy
 
Thanks for your reply spacepro.

I'm going to use VBA, and the link is the same every time. I have never mailed through Access, so any help here is much appreciated.
 
Hi,

You can automate the email automatically or choose to open the message before sending by using the sendobject command.
Here is an example with the requested link :

DoCmd.SendObject acReport, "Your Report", "SnapshotFormat(*.snp)", "joe.bloggs.co.uk"', "CC Email Address here", "BCC Email Address here", "Subject Text here", " Your message goes here - Line 1." & vbcrlf & "Line 2 of Message goes here", False 'False sends message automatically. True opens message for editing, ""

Use the above but soon as you enter docmd.sendobject in VBA it will show you what you need to enter. Just add the vbcrlf with & either side of this to add spaces.

Enter your hyperlink in the message text area of the code as you would type it like : http://www.microsoft.com

Just put the following code on the click event of a command button and job done.

Hope this helps

Andy
 
Hi Andy!

Thanks for your thourough explanation. Much appreciated!. I'll try it out and if I have any questions, I'll post back. Thanlks again.
 
Hi all,

I don't get the SendObject to work!

Here's the line I use:

DoCmd.SendObject acSendReport, "rptChargeData", acFormatRTF, "emailaddresshere@anywhere", , , _
"Chargerapport", "Hi!-This is a test. It doesn't work", True

I should have it in Snapshot view, the RTF format is only another format I tried out. The line of code above runs without any errors, without anything happening at all. What is wrong? Do I have to set some options or something to make it work. I used Outlook Express as my e-mail software, but I've changed it to Outlook. Makes no difference though.

Thanks in advance for any help
 
Hi Geralf,

Try putting " " either side of the format of the report. If you fail to do this, then create a macro filling in all the conditions and then ensure the macro is highlighted in the database window, then select Macro on the Tools Menu and choose 'Convert Macro to Visual Basic'.

Access will convert the macro to code then adjust the code to your needs.

Test the Macro before conversion.

Hope this helps

Andy

This is the code you need as it is:

Code:
DoCmd.SendObject acSendReport, "rptChargeData", "acformatRTF", "emailaddresshere@anywhere", , , "Subject Goes Here", "Hi!-This is a test. It doesn't work", True
 
Last edited:
Hi Andy!

Thanks for your assistance here. I made the macro (1 line with the SendObject command, and filled in appropriate fields for Object type, name, send to etc, saved it and ran it without it working. Just the same way my code does. What can be wrong here?
 
Hi again Andy!

Found it! Under 'Advanced in Access Options, my 'Ignore DDE requests was not selecte (I find it a bit strange that this means when it's checked it will be ignored. I would think it should be the other way round). So now it works!

Thanks again for your help and interest Andy.
 
SendObject is working great now. The report is produced when the code is run. Is it possible to add an attachment? (automatically using VBA?)

Thanks in advance
 
Thanks again Andy! It sure does. I now have a new library to explore. I've found similar code in here, but I want to make my own 'procedure' howthe mail is being sent. My idea is that I want first to view the report, either in Access report format or Snapshotview, then make a snapshot file which should be attached to the mail message, and I want to get the e-mail address from Outlook's addrerss book. I'm almost there now, but hey it's late (or early :)), so I'll continue tomorrow. If I find the code inr\teresting enough I'll post it. Thanks again for your help.

PS. The SendObject only works the first time when I run it. Then I'll have to close the db and reopen it to make it work again. So I'll definitely stick to the Outlook library!
 

Users who are viewing this thread

Back
Top Bottom