?
Solved

Link to open VB app

Posted on 2006-10-26
11
Medium Priority
?
228 Views
Last Modified: 2010-08-05
Hello Experts,

I have an application that sends out an email through M$ Outlook. It notifies the recipient that a change has happened and asks them to login and check the change. Is there a way to have the exe open when the link is clicked in the email and also pass some data to the app, lets say a number to appear in a text box?

I have the app sending the email no problem. I just want to open the app and pass it a value from the email once the link is clicked.

Is this doable?

Thank you,
Zac
0
Comment
Question by:sacul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 12

Expert Comment

by:sandip132
ID: 17817413
System.Diagnostics.Process.Start("mailto:astark1@unl.edu?subject=MailTo Comments&cc=ASTARK1@UNL.EDU,id@internet.node")

Happy Programming.
Sandip.
0
 
LVL 1

Author Comment

by:sacul
ID: 17820319
Hello,

I think the code above starts the outlook editor. What I meant was after the email has been sent create a link in the email that starts a VB app.

so the email would look like this

"There was an update to the program. Please click the link.
C:\app.exe"

and by clicking the C:\app.exe link the vb app would start.

Thank you,
Zac
0
 
LVL 14

Expert Comment

by:shahprabal
ID: 17820630
This is doable if the email recepient is on the same Intranet (LAN) as the app. So if the app resides on a server on a shared drive which all of the client computers map as P: then the email can contain the shared drive followed by the app name eg: P:\\WinApp.exe

As far as passing data to it goes... you should be able to pass command parameters to the app and retrive it... eg: P:\\WinApp.exe User:xyz Error:123

Use the following code to get the values :

m_strUser = Mid(GetCommandLineArgs(0), 6)
m_strError = Mid(GetCommandLineArgs(1), 6)

    Public Function GetCommandLineArgs() As String()
        ' Declare variables.
        Dim separators As String = " "
        Dim commands As String = Microsoft.VisualBasic.Command()
        Dim args() As String = commands.Split(separators.ToCharArray)
        Return args
    End Function
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:sacul
ID: 17821243

Hello,

The app is installed on each users local computer. This is the the code I used to get the app running

        Dim objOutlook
        Dim objOutlookMsg
        objOutlook = CreateObject("Outlook.Application")
        objOutlookMsg = objOutlook.CreateItem(0)

        Dim testStr As String = System.Web.HttpUtility.UrlPathEncode("C:\app.exe")

        With objOutlookMsg
            .To = "address@domain.com"
            .Subject = "Test"
            .HTMLBody = "TEST " & "<a href=" & testStr & "> TEST </a>"
         
            Try
                .Send()
                MessageBox.Show("Your request is being processed.")
            Catch default as Exception
                MessageBox.Show(default.Message)
                Exit sub
            End Try
        End With

I am not sure what this part does though,

"Use the following code to get the values :

m_strUser = Mid(GetCommandLineArgs(0), 6)
m_strError = Mid(GetCommandLineArgs(1), 6)

    Public Function GetCommandLineArgs() As String()
        ' Declare variables.
        Dim separators As String = " "
        Dim commands As String = Microsoft.VisualBasic.Command()
        Dim args() As String = commands.Split(separators.ToCharArray)
        Return args
    End Function"

Thank you,

Zac
     
0
 
LVL 1

Author Comment

by:sacul
ID: 17821353
Hello,

This part gives me an error.

C:\app.exe User:xyz Error:123

It says the file cannot be found.

Thank you,
Zac
0
 
LVL 14

Expert Comment

by:shahprabal
ID: 17843912
Zac the code I had included was to read values from the parameters (user and error values). Assuming the path in the email is correct I would guess the issue is security related...  I haven't played with opening apps through outlook so you would need to play a little with it and see if works if :

1) The app is located in a shared folder.
2) The system has access to the folder that app is located in.
3) The user is running as an admin.
4) Try sending a link to a shortcut for the app and not to the app itself.

HTH
good luck
0
 
LVL 1

Author Comment

by:sacul
ID: 17850772
Hello shahprabal ,

I did try to play around with it a little. I am running as an administrator on my PC and the app is running local on this pc. What I don't understand is how to pass the parameters from the click-able link.

"you should be able to pass command parameters to the application and retrieve it... eg: P:\\WinApp.exe User:xyz Error:123"

My click-able link is "C:\app.exe User:xyz" Error:123" but I think it is looking for a path that has the full name "C:\app.exe User:xyz Error:123" in it. I can get it running no problem with "C:\app.exe" but I don't understand how to pass the parameters since "C:\app.exe User:xyz Error:123" alters the path and makes the link point to something doesn't exist.

Do you know of any references on the web where I can read up more on the topic?

Thank you,
Zac
0
 
LVL 14

Expert Comment

by:shahprabal
ID: 17850935
Ok... If the parameters are causing the problem the quick fix I can think of (this works only if the values you want to supply don't vary) is that you create a shortcut for the app and include the parameters in the target. eg:
"C:\app.exe" User:xyz Error:123

So if you only have 5 different values for error then you would need 5 shortcuts (user value would be same in all the shortcuts). I know this is not ideal and will try to find something better.
0
 
LVL 14

Accepted Solution

by:
shahprabal earned 2000 total points
ID: 17857797
Another way could be using a batch file... you get the variables in the batch file and pass it to the app... check out...

http://www.windowsitpro.com/Article/ArticleID/13443/13443.html

and

http://www.daniweb.com/techtalkforums/thread56670.html
0
 
LVL 1

Author Comment

by:sacul
ID: 17937720
Hello,

I am sorry I took so long to accept. I have been reading up on the two links that you posted. I am not very good with batch files so I have to get some more info on how to get it set up.

Thanks for all the help.

Zac
0
 
LVL 14

Expert Comment

by:shahprabal
ID: 17939936
No problem. I did search for a better option but didn't come across any... logic says there has to be a way... I don't use batch files much anymore either... but if you have follow-up qts please let me know... also if you get it working do post it. Thanks for the grade.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question