The following should call outlook on the user's pc. It is worth a
try.....
in the onclick event of a button to send email
Here is an example:
Set o = CreateObject("Outlook.Application")
Set m = o.CreateItem(0)
m.To = "Paul Tucker" ' The distribution list name goes here
m.Subject = "SUPP Analysis Spreadsheet "
m.body = Chr(13) & Chr(13) & _
" Date: " & date & Chr(13) & _
Chr(13)
m.attachments.Add ReportDir & exportName ' point to the full address of
attachment here
' There can be multiple of the above
' m.display ' display shows email and the user has to press send button
m.send ' Send does it automatically with security from Outlook
' You want to use m.display to open the email and have the user send
it.
' you want to use me.send to start the send process - however MS
Outlook security
' will ask for the user's OK to actually send the email.
' I believe that the next two instructions should be
set m to nothing
and possibly
set o to nothing
'not sure on the above.
==========================
The trick will be accessing the email address. I am not sure what you
mean by hyperlink to the email address in your description. But if the
address is a field in the file or at least on the form the above will
work
Ron
Ron,
Thank you for your answer. I have read through it and I don't see
where the code is going to back reference or figure out:
-not to use the email program on the server
- and to use the email program on the user's computer.
The database sits on a server. Each user has a link on their desktop
that enables them to access the server. After a password prompt, the
database appears on their screen.
I have the following code on the click event of a label that sits right
beside the email text field. The code is as follows:
Private Sub lblHyperLink_Click()
Dim strMail As String
strMail = "#MailTo:" & Me.EMAIL & "#"
Application.FollowHyperlink HyperlinkPart(strMail, acAddress)
End Sub
It works well - except - it pulls up an email and puts in the email
address on the server email program. It is not accurate to have this
situation. I want the code to decipher that it is not to use the email
program on the server, but to access or decipher or reference the email
program on the user's computer. In that way, when the user sends the
email, it comes from the user, not the server's email. Basically, I
want the Focus to move from the server environment back to the user's
environment and to use the user's email address.
I am guessing I need to find the server path, and then from there find
the path to the user's computer through the network. I am imagining
there is code that can determine what user/what computer is
current/asking and then use the answer to that query to fill in the
path that will put the point of reference back to the user's computer
instead of being on the server.... all this while holding the email
address and plunking that into the email message when done.
When the user hits SEND, they will have left the database on the
server, so that's another story. For now, I just need to get the
SetFocus (for lack of better wording), to back out of the server and
focus on the user's computer.
Any comments and insights are very appreciated.
Clare Allan
Ron2005 - 31 Mar 2006 15:58 GMT
I have never attempted to call the email program using a hyperlink.
I gues I am suggesting that since you have the email address then try
the code I posted. It will call outlook specifically, so then it is a
question of where the individual PC will resolve that call.
I will think about it for a while to see if anything comes to mind.
Ron