Page Index Toggle Pages: [1] 2 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Programming help (Read 6470 times)
Dnolan
Member
*
Offline


No personal text

Posts: 20
Joined: Feb 27th, 2004
Programming help
Mar 26th, 2004 at 6:31pm
Print Post Print Post  
Does anyone have any ideas on how to click on a field and have it pop up an email in Outlook express?

Or even to click on a field and have it open explorer?

I really need help on this! I'm really confused here and need some clarification.

THANKS!
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Programming help
Reply #1 - Mar 26th, 2004 at 7:39pm
Print Post Print Post  
Take a look at the @shell command starting on page 111 of the programming Guide.

If you need more info let us know.

This is an example of calling Lantica  calandar program and tells were to return value

@MSG (@SHELL ("C:\Sesame\utils\lancal.exe c:\sesame\utils\mydate.txt"))
DOB = @insert("c:\sesame\utils\mydate.txt")
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Dnolan
Member
*
Offline


No personal text

Posts: 20
Joined: Feb 27th, 2004
Re: Programming help
Reply #2 - Apr 8th, 2004 at 6:30pm
Print Post Print Post  
all the pg.111 tells me to do is use @shell. So I did that with this code:

var IEWebSite as Int
var IEpath as String
IEpath = @Chr(34) + "C:/Program Files/Internet Explorer/IEXPLORE. EXE" + @Chr(34)

If IEWebSite <> "" THEN
   IEWebSite = @Shell (IEpath + " + "WebSite")
IF NOT IEpath = 0 THEN
    @Msg ("Couldn't open web browser")
//@Shell returns a 0 if it is sucessful, a 1 if it fails

However, there are no warnings or anything in the program editor, but when I click on the web site field it doesn't do anything. I'm trying to get it so that when I click on the field it brings up internet explorer and copys and pastes the web site into the url box. What is wrong with my code? I really need to figure this out, but I'm totally clueless here! If someone could rescue me it would be great!

THANKS!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming help
Reply #3 - Apr 8th, 2004 at 6:38pm
Print Post Print Post  
The way your code is written, you are declaring IEWebSite as an Int. You don't set it to anything. You then check to see if it is not equal to "".

1. An Int cannot reliably be checked with "".
2. I suspect you are actually wanting to check an element on your form to see if it has a value.
3. You are not checking the correct return value.

Try something like this:
Code
Select All
var IEWebSite as Int
var IEpath as String
IEpath = @Chr(34) + "C:\Program Files\Internet Explorer\IEXPLORE. EXE" + @Chr(34)

If WebSite <> "" Then
   IEWebSite = @Shell (IEpath + " " + WebSite)
If Not IEWebSite = 0 Then
    @Msg ("Couldn't open web browser")  



You may also want to make sure your slashes are going the right way where you set IEpath.
« Last Edit: Apr 9th, 2004 at 3:41pm by Hammer »  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Programming help
Reply #4 - Apr 8th, 2004 at 10:56pm
Print Post Print Post  
Here is some syntax that can be called with @shell for Outlook Express:

Quote:
"FullPath\Outlook Express\msimn.exe" /mailurl:mailto:<Recipient>

or with a distribution list

"FullPath\Outlook Express\msimn.exe" /mailurl:mailto:<Recipient1>?subject=<my subject>&CC=<Recipient2>;<Recipient3>&BCC=<Recipient4>;body=Hello World

Sample:
"FullPath\Outlook Express\msimn.exe" /mailurl:mailto:MyName@myplace.com


Works in other programs, I have not actually used with Sesame shell but expect it will be OK
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Dnolan
Member
*
Offline


No personal text

Posts: 20
Joined: Feb 27th, 2004
Re: Programming help
Reply #5 - Apr 9th, 2004 at 3:24pm
Print Post Print Post  
I tried the code but this error came up:

Error whil parsing module "Web Site - www.(4)"
    Unknown Identifier.
Line 5, position 4 [Identifier:Web]
    If Web Site
         ^

What does that mean? And how can I fix it???
Thanks!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming help
Reply #6 - Apr 9th, 2004 at 3:32pm
Print Post Print Post  
Could you post the entire code snippet? It's hard to find syntax error with just that little bit.  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Dnolan
Member
*
Offline


No personal text

Posts: 20
Joined: Feb 27th, 2004
Re: Programming help
Reply #7 - Apr 9th, 2004 at 3:34pm
Print Post Print Post  
OH boy! I just tried the code for the outlook that Bob_Hansen gave and it says:

Error whil parsing module "Contact E-mail (4)"
    Statement or End-Of-File expected.
Line 1, position 1 :[String:"C:\Program Files\Outlook Express\msimn.exe"]
"C:\Program Files\Outlook Express\msimn.exe"
   ^

I have NO idea what any of this means, if someone could translate it and help me out that would be wonderful.

I'm so confused!!   Cry

Thanks everybody!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming help
Reply #8 - Apr 9th, 2004 at 3:36pm
Print Post Print Post  
You have a syntax error someplace. We can't find it without seeing the whole piece of code.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Dnolan
Member
*
Offline


No personal text

Posts: 20
Joined: Feb 27th, 2004
Re: Programming help
Reply #9 - Apr 9th, 2004 at 4:10pm
Print Post Print Post  
Ok. I enter the code in Web Site -www. field on the On Form Entry part.
This is the code:
Code
Select All
var WebSite as Int
var IEpath as String
IEpath = @Chr(34) + "C:\Program Files\Internet Explorer\IEXPLORE.EXE" + @Chr(34)

If WebSite <> " Then
   WebSite = @Shell (IEpath + " " WebSite)
If Not WebSite = 0 Then
   @Msg ("Couldn't open web browser")
 



I hope that helps! Thanks!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming help
Reply #10 - Apr 9th, 2004 at 4:19pm
Print Post Print Post  
You have several problems here:

1. Web site - www. contains illegal characters in the element name. You need to rename this element before it can be used in programming.

2. You reference an element named "WebSite" in your code, but it does not appear to be named that. Problems 1 and 2 will both be solved by renaming the element to WebSite.

3. You have several other syntax errors.
var WebSite as Int
should be
var IEWebSite as Int
(so it is not named the same as your element)

If WebSite <> " Then
should be
If WebSite <> "" Then

WebSite = @Shell (IEpath + " " WebSite)
should be
IEWebSite = @Shell (IEpath + " " + WebSite)
(Note the corrected variable name and the added + sign)

If Not WebSite = 0 Then
should be
If Not IEWebSite = 0 Then
(Note we're checking the variable, not the element value)

Here's the whole thing corrected, assuming you rename the element to be called WebSite.
Code
Select All
var IEWebSite as Int
var IEpath as String
IEpath = @Chr(34) + "C:\Program Files\Internet Explorer\IEXPLORE.EXE" + @Chr(34)

If WebSite <> "" Then
   IEWebSite = @Shell (IEpath + " " + WebSite)
If Not IEWebSite = 0 Then
   @Msg ("Couldn't open web browser")
 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Dnolan
Member
*
Offline


No personal text

Posts: 20
Joined: Feb 27th, 2004
Re: Programming help
Reply #11 - Apr 9th, 2004 at 4:31pm
Print Post Print Post  
I have a field with the contact's email in it, such as Joe.Smith@yahoo.com and I want to click on that field and have it open up an email from Outlook Express with Joe.Smith@yahoo.com in the To: part of the email.

Would this be possible? And how would I do it?
???
Thanks!
  
Back to top
 
IP Logged
 
Dnolan
Member
*
Offline


No personal text

Posts: 20
Joined: Feb 27th, 2004
Re: Programming help
Reply #12 - Apr 9th, 2004 at 4:53pm
Print Post Print Post  
I tried out your code and this is what happened:

Error while parsing module "Web Site (4)"
Unknown Identifier
Line 5, position 4:[Identifier:Web Site]
If WebSite <>
    ^

I also changed the element name to Web Site. I'm not sure why it won't work so if you could clarify, it would be appreciated.

Thanks!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming help
Reply #13 - Apr 9th, 2004 at 5:18pm
Print Post Print Post  
WebSite and Web Site are not the same thing. Note that one has a space and the other does not.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Programming help
Reply #14 - Apr 10th, 2004 at 1:37pm
Print Post Print Post  
DNolan,

For both Website and Email opening, you will add a command buttons. Enter following Codes in the respective Command Button On Element Entry Event.


For WebSite:
===============
var IEpath as String
var IEfailure as Int
IEPath = @Chr(34) + "C:\Program Files\Internet Explorer\IEXPLORE.EXE" + @Chr(34)
// The @Chr(34) wraps double quotes around the pathname of Internet Explorer

IF WebSite <>"" THEN
   IEfailure = @Shell(IEpath + " " + WebSite)
IF NOT IEfailure = 0 THEN
   @Msg("Couldn't open web browser")
// @Shell returns a 0 if it is successful, a 1 if it fails
/* WebSite is the Name of the Element which stores website address, you might have to replace that as per the name you have given for that element */

============

For Outlook Express, the following code will go in On Element Entry Event on the Command Button.

===============
var Outlook_Exp_Path as string
var OutLook_failure as Int

Outlook_Exp_Path = @Chr(34) + "C:\Program Files\Outlook Express\msimn.exe" + @Chr(34)


IF Email <>"" THEN
   OutLook_failure = @Shell(Outlook_Exp_Path + " " + "/mailurl:mailto:" + Email)
IF NOT OutLook_failure = 0 THEN
   @Msg("Couldn't open Outlook Express")
// @Shell returns a 0 if it is successful, a 1 if it fails

/* Email is the Name of the Element which stores e-mail address, you might have to replace that as per the name you have given for that element */

===================

Both of the above work work perfectly fine for me. Please let us know how do they work for you. You just have to change the name of two elements namely WebSite and Email, as per your application.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send Topic Send Topic Print Print