473,889 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email Item as Link from Access

TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Assumptions:
I know how to create email from within Access, using outlook automation.
User has the access frontend installed
Office 2003

Is it possible to create a hyperlink in a email that will accomplish the following, when receiver clicks it:?

Open the access front-end on the users PC.
Open relevant form
Goto relevant Item


If its not possible in the way I have described it, I have several modifications that could be acceptable, for example, it would be ok to require that the user has the frontend open when clicking the link. It would also be ok if I had to install a add-on to the users outlook.
Jan 19 '12
54 14429
ADezii
8,834 Recognized Expert Expert
@Mariostg:
Thanks for the clarification. I actually tried to work Command Line Arguments into the following Syntax, utilizing HTMLBody, but as of yet, to no avail.
Expand|Select|Wrap|Line Numbers
  1. .HTMLBody =  "<a href=file://C:\Test\FE.mdb>Click to Open Database</a>"
Jan 24 '12 #31
NeoPa
32,584 Recognized Expert Moderator MVP
I've tried to avoid any reliance on using HTML type emails. If you could let us know if that can be assumed then it might make it all a lot easier (as HTML tags will then become feasible).
Jan 24 '12 #32
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
The message will likely be read in outlook 2003. What that means in terms of html or not I honestly dont know.
Jan 24 '12 #33
ADezii
8,834 Recognized Expert Expert
I have developed some Code that will:
  1. Send an E-Mail to any User consisting of a Semi-Colon Delimited List of Values placed in the Subject of the E-Mail (Employees;FL;3 3484).
  2. Minimal Code (Outlook VBA) on the End Users PC examines the Incoming Item, then:
    1. If it is in fact an E-Mail, and nothing else, and
    2. If it is from a specific Sender (TheSmileyCoder ),
  3. Opens Access and sends the Subject String (Employees;FL;3 3484) as a Command Line Argument where Access can now parse it into its individual Elements, and make the appropriate action.
  4. The problem is that, right now, there is absolutely no User Intervention. You would send the E-Mail, and Access would Open on the End User's PC with the appropriate Command Line Arguments.
  5. This approach is rather 'Rogue', even by my standards, but if you are interested just let me know and I'll post the insanity (LOL).
Jan 24 '12 #34
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Hi Adezii.

It sounds good. I don't like the rogue part either, but I figure it would be possible to convert whatever outlook code you have to something that could be placed in a custom outlook button? And thus only execute when the user presses said button.

I would like very much to see what you have.
Jan 24 '12 #35
ADezii
8,834 Recognized Expert Expert
  1. An E-Mail would be sent to the End User with the Subject consisting of a Delimited List of Values, such as: Employees;FL;33 484.
  2. In Outlook, on the End User's PC, Macros must be enabled in some manner.
  3. In the ThisOutlookSess ion Code Module of Outlook:
    Expand|Select|Wrap|Line Numbers
    1. Public WithEvents myOItems As Outlook.Items
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Application_Startup()
    2.   Set myOItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items
    3. End Sub
    4.  
    Expand|Select|Wrap|Line Numbers
    1. Private Sub myOItems_ItemAdd(ByVal Item As Object)
    2. Dim varRetVal As Variant
    3.  
    4. 'Is this an E-Mail Item?
    5. If TypeName(Item) = "MailItem" Then
    6.   With Item
    7.     If .Sender = "Dezii, Armund" Then       'Execute if only from this Sender
    8.       'Open the Front End Database, passing to it the Delimited String
    9.       varRetVal = Shell("C:\Program Files\Office 2003\OFFICE11\MSACCESS.EXE C:\Test\FE.mdb /cmd " & _
    10.                          .Subject, vbMaximizedFocus)
    11.     End If
    12.   End With
    13. End If
    14. End Sub
    15.  
  4. At some Entry Point in the Front End Database, parse the Command String, and take some action accordingly:
    Expand|Select|Wrap|Line Numbers
    1. Dim varSplit As Variant
    2.  
    3. varSplit = Split(Command, ";")
    4.  
    5. Debug.Print "Form Name : " & varSplit(0)
    6. Debug.Print "State Name: " & varSplit(1)
    7. Debug.Print "Zip Code  : " & varSplit(2)
  5. Code has been tested with Outlook/Access 2003, and is functional. Should be a simple matter to channge it to a Manual Operation as opposed to Automatic.
Jan 24 '12 #36
ADezii
8,834 Recognized Expert Expert
@TheSmileyCoder :
The more that I think about this, the more I feel as though Outlook needs to 'Capture' your E-Mail as soon as it arrives, then Prompt the User for a Response. The following, slightly revised, Code appears to accomplish this quite well. It displays a Modal Dialog Box (Message Box) to the User while at the same time allowing E-Mails to filter in behind it. I really was not sure how this Logic would play out, but it apparently does.
Expand|Select|Wrap|Line Numbers
  1. Private Sub myOItems_ItemAdd(ByVal Item As Object)
  2. Dim varRetVal As Variant
  3. Dim intResponse As Integer
  4.  
  5. 'Is this an E-Mail Item?
  6. If TypeName(Item) = "MailItem" Then
  7.   With Item
  8.     If .Sender = "Dezii, Armund" Then       'Execute if only from this Sender
  9.       intResponse = MsgBox("Open Access Database with Parameters specified in the Subject Field?", _
  10.                     vbDefaultButton1 + vbQuestion + vbYesNo, "Open Access Prompt")
  11.       If intResponse = vbYes Then
  12.         'Open the Front End Database, passing to it the Delimited String
  13.         varRetVal = Shell("C:\Program Files\Office 2003\OFFICE11\MSACCESS.EXE C:\Test\FE.mdb /cmd " & _
  14.                            .Subject, vbMaximizedFocus)
  15.       End If
  16.     End If
  17.   End With
  18. End If
  19. End Sub
  20.  
Jan 25 '12 #37
Mariostg
332 Contributor
@ADezii
I am amazed. Pretty clever to tell outlook to parse the subject line.
I have a routine that sends emails with subject pretty much broken down like you suggested. But it does not go beyond that. I will definitely have to look at extending this with the proposed codes.
Jan 25 '12 #38
ADezii
8,834 Recognized Expert Expert
@Mariostg:
Outlook is basically passing the Subject Line to Access in tact as a Command Line Parameter, Access is actually doing the parsing and further processing.
Jan 25 '12 #39
ADezii
8,834 Recognized Expert Expert
One obvious flaw in my Logic is if TheSmileyCoder wanted to send a Standard E-Mail to a Recipient, one that did not require the Opening on an Access Database. My simple workaround was to also check for the exclusion of a Semi-Colon in the Subject Line (Code Line #8), in addition to being a Mail Item and from TheSmileyCoder.
Expand|Select|Wrap|Line Numbers
  1. Private Sub myOItems_ItemAdd(ByVal Item As Object)
  2. Dim varRetVal As Variant
  3. Dim intResponse As Integer
  4.  
  5. 'Is this an E-Mail Item?
  6. If TypeName(Item) = "MailItem" Then
  7.   With Item
  8.     If .Sender = "TheSmileyCoder" And InStr(.Subject, ";") <> 0 Then
  9.       intResponse = MsgBox("Open Access Database with Parameters specified in the Subject Field?", _
  10.                     vbDefaultButton1 + vbQuestion + vbYesNo, "Open Access Prompt")
  11.       If intResponse = vbYes Then
  12.         'Open the Front End Database, passing to it the Delimited String
  13.         varRetVal = Shell("C:\Program Files\Office 2003\OFFICE11\MSACCESS.EXE C:\Test\FE.mdb /cmd " & _
  14.                            .Subject, vbMaximizedFocus)
  15.       End If
  16.     End If
  17.   End With
  18. End If
  19. End Sub
Jan 25 '12 #40

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

Similar topics

2
3362
by: James Fraley | last post by:
I've created a MS Access form and get the exact same results as below? Now, I believe it has something to do with storing EMails, not OLE. I will appreciate any help! --------------------------------------------------------------- I've created a form with an OLE obect linked to a MS Access OLE Object. I need to store an email from Outlook in the field. Everything works fine if I drop the email on my desktop and then pick
5
5414
by: Alan | last post by:
Hello, I trying to export my email to an access database. Outlook already this function, but not all the fields are available once the export is complet. The time & date stamps are not available. Also, the attachment file names field is not present. Are there other means of obtaining these information? Regards,
0
1391
by: gj | last post by:
If anyone has worked with this I would be interested to find out. I have successfully put send/receive emails into an application using SMTP/POP server but would like to do something more professional with IMAP. I basically want a full email client in Access that can connect to an IMAP server. I have played with a few ActiveX controls but would like others experiences. TIA
7
5421
by: Daven Thrice | last post by:
I know how to send email out of Access, and that's no problem. What I need to figure out is how to receive email into access. Say that I give access an email address, such as access@daven.com. I want all email that comes to that address to be received directly by the database so that I can parse out the files. I'm thinking that, worst case, I can write my own email client using the winsock control. But is that my only alternative?
8
9640
by: tymperance | last post by:
I have a report that I currently email directly from Access as an attachment using a macro. I need to make it be the body of the email instead. Can that be accomplished without extensive VBA programming? Thanks!
2
9002
by: diwadube2003 | last post by:
I get a Warning message while automatically sending email through MS Access, using Outlook. Can anybody help me out with this.
6
6927
by: ttamilvanan81 | last post by:
Hai. I needto Receive Email using Ms-Access and Outlook. On the receiving end, the user receives the email at the Outlook. When they opens the Email, the message box should have a button called “Save to Access”. When this button is pressed, a dialog box should pop up where the user can choose a contact name and a job name and click on SAVE Here contact name and job name are in the access table fields. We go to select any one contact...
2
1809
by: PPPPPPPPP | last post by:
I Am Not Able To Link Access Database In Visual Basic .please Help Me To Do So . Thanking You In Anticipation.
0
2071
by: wassimdaccache | last post by:
Hello Experts; I have a wireless router TP-link I made security phrase for it. What i am trying to do is to configure a d-link access point as a repeater for the TP-link and always not working :(!!! while i am scanning in my access point (d-link) I see the tp-link and I am able to connect but when I scan using my wifi on my laptop I'm not seeing the D-link . Why ?
4
1921
by: davekearley | last post by:
Hi all, first post, looks like a great site. I have a small problem with Access. I need to link to an ODBC table (SQL7) but when i go to the link dialogue, the ODBC entry is missing. I have other linked tables in this DB and they all re-link ok so the system DSN is working fine. Any ideas? I have not linked a table for some time and cant remember how to get the ODBC option back.
0
9969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11203
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10794
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9612
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7999
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7151
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5830
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4650
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.