473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Detect ActiveX

I have an ASP.Net page that displays documents as hyperlinks from a network
folder (intranet application). I also have a column that contains a
hyperlink to open the document in Microsoft Word. All works fine unless
someone has ActiveX disabled on their browser. Is there any way I can
detect that so I can give them a warning?

The script for opening a Word document is below. Thanks.

-David

<script language="javascript" type="text/javascript">

function openWord(spath)
{
var pause = 0;
var wdDialogFileOpen = 80;
var wdApp = new ActiveXObject("Word.Application");
wdApp.Visible = 'True';
var wdDoc = wdApp.Documents;
wdDoc.Open(spath);
document.form1.submit();
}

</script>
Nov 11 '08 #1
1 2368
On Nov 11, 7:06*pm, "David C" <dlch...@lifetimeinc.comwrote:
I have an ASP.Net page that displays documents as hyperlinks from a network
folder (intranet application). I also have a column that contains a
hyperlink to open the document in Microsoft Word. *All works fine unless
someone has ActiveX disabled on their browser. *Is there any way I can
detect that so I can give them a warning?

The script for opening a Word document is below. *Thanks.

-David

<script language="javascript" type="text/javascript">

function openWord(spath)
{
* * var pause = 0;
* * var wdDialogFileOpen = 80;
* * var wdApp = new ActiveXObject("Word.Application");
* * wdApp.Visible = 'True';
* * var wdDoc = wdApp.Documents;
* * wdDoc.Open(spath);
* * document.form1.submit();

}

</script>
Hi David,

I think you can simply add the try..catch block to check the result of
ActiveXObject

try {

var wdApp = new ActiveXObject("Word.Application");
wdApp.Visible = 'True';
var wdDoc = wdApp.Documents;
wdDoc.Open(spath);
document.form1.submit();

} catch (er) {

alert('You have no Word ActiveX');

}
Nov 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: SiuLoBow | last post by:
Hi, Is there anyway to detect the ActiveX control is able to run on the browser or not? After I installed the ActiveX control to my system, user sometimes switch the secruity setting to "not...
5
by: Andy | last post by:
Hi, I'm trying to use javascript to detect the version of internet explorer before running an active x control. I'm after the full version number (eg not just IE6 but 6.0.2800.1106). Is there...
1
by: Oscar Thornell | last post by:
Hi, I need to detect (from a web page..) what version of Windows Media that are installed.. Any suggestions?? Regards /Oscar
3
by: Sara | last post by:
HI, I want to code a program to detect GSM mobile (any kind) which connected through serial port to computer and then be able to send SMS through this mobile phone to other mobile phones, could...
6
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
8
by: BJ | last post by:
Problem: How can I code up a client side process to detect if the network is available? Synopsis: I am writing ASP.NET input forms for a Panasonic Tuff book. The users will be walking around...
35
by: nobody | last post by:
I need to pop up a modal JS-based dialog (for some reason can't use popup window, much less so showModalDialog()), and I'd like to imitate the system popup titlebar according to user's desktop...
1
by: mahesh singh | last post by:
Hi Everyone, I am a new joinee to this site. Need help regarding a particular problem. I dont have much experience as a .net developer (1 year) and m hoping that somebody here wud b able to help...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.