A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How do I get JavaScript to run in Outlook?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 18th 06, 10:18 PM posted to microsoft.public.outlook
Chris Mahoney
external usenet poster
 
Posts: 8
Default How do I get JavaScript to run in Outlook?

Hi

I'm on a LAN, and all users have Outlook 2003. I'm trying to create an
email message which includes a link to open an InfoPath form. I'm
currently using the following code:

html
head
titleInfoPath Launcher/title
script language="javascript" type="text/javascript"
function launchInfoPath()
{
objInfoPath = new ActiveXObject("InfoPath.Application");
strXSFPath = "D:\\Path\\manifest.xsf";
objInfoPath.XDocuments.NewFromSolution(strXSFPath) ;
}
/script
/head
body
Click a href="javascript:launchInfoPath();"here/a to open form.
/body
/html

That code works perfectly in IE (InfoPath opens and the form appears),
but not in Outlook. When you click the link, IE opens for a
split-second then closes itself, and InfoPath doesn't start at all.
Outlook seems to be disabling (some of?) the JavaScript, yet I can't
find any settings for it.

Does anyone have any suggestions? I've already asked in
microsoft.public.infopath but nobody could help

Thanks
Chris

Ads
  #2  
Old April 18th 06, 10:39 PM posted to microsoft.public.outlook
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default How do I get JavaScript to run in Outlook?

That's expected behavior. For security reasons, Outlook doesn't run code in HTML messages.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Chris Mahoney" wrote in message oups.com...
Hi

I'm on a LAN, and all users have Outlook 2003. I'm trying to create an
email message which includes a link to open an InfoPath form. I'm
currently using the following code:

html
head
titleInfoPath Launcher/title
script language="javascript" type="text/javascript"
function launchInfoPath()
{
objInfoPath = new ActiveXObject("InfoPath.Application");
strXSFPath = "D:\\Path\\manifest.xsf";
objInfoPath.XDocuments.NewFromSolution(strXSFPath) ;
}
/script
/head
body
Click a href="javascript:launchInfoPath();"here/a to open form.
/body
/html

That code works perfectly in IE (InfoPath opens and the form appears),
but not in Outlook. When you click the link, IE opens for a
split-second then closes itself, and InfoPath doesn't start at all.
Outlook seems to be disabling (some of?) the JavaScript, yet I can't
find any settings for it.

Does anyone have any suggestions? I've already asked in
microsoft.public.infopath but nobody could help

Thanks
Chris

  #3  
Old April 18th 06, 10:50 PM posted to microsoft.public.outlook
Chris Mahoney
external usenet poster
 
Posts: 8
Default How do I get JavaScript to run in Outlook?

So what can I do?

  #4  
Old April 18th 06, 11:00 PM posted to microsoft.public.outlook
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default How do I get JavaScript to run in Outlook?

One possible solution would be to give users a URL to a web page with code behind it to launch the form. If you are working in an Exchange organization and have permission to publish to the Organizational Forms library, you could use VBScript behind a published custom Outlook message form.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Chris Mahoney" wrote in message oups.com...
So what can I do?

  #5  
Old April 18th 06, 11:21 PM posted to microsoft.public.outlook
Chris Mahoney
external usenet poster
 
Posts: 8
Default How do I get JavaScript to run in Outlook?

Sue Mosher [MVP-Outlook] wrote:
One possible solution would be to give users a URL to a web page with code behind it to launch the form.


Just thought of that one and came back to ask whether it would work.
Since you've already suggested it, that's probably a Yes

  #6  
Old April 18th 06, 11:47 PM posted to microsoft.public.outlook
Chris Mahoney
external usenet poster
 
Posts: 8
Default How do I get JavaScript to run in Outlook?

Yep, it's all working now

Thanks!

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook automation in javascript [email protected] Outlook - General Queries 1 April 7th 06 12:16 PM
Pure HTML Formatting in Javascript Code [email protected] Outlook - General Queries 1 April 6th 06 03:47 PM
outlook won't run when reinstalled on a new computer outlook grim Outlook - Installation 7 April 3rd 06 10:05 PM
How do I Run Outlook and keep it on the hard disk Mike Outlook - General Queries 3 February 20th 06 07:06 PM
Outlook should run in a backround mode. Marcus Gray Outlook - Calandaring 1 February 1st 06 11:29 PM


All times are GMT +1. The time now is 08:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.