activexobject

Read file names in a local folder in an HTML page

陌路散爱 提交于 2019-11-27 07:27:42
问题 I am creating a HTML page where I need to display the names of the files present in the specific local folder, example - C:\Users\User1\Documents\folder1 . I tried to write the code in java script but have not succeeded yet. Most of the question threads mention about "ActiveXObject" to be used but that itself does not work for me. Reference: JavaScript: Read files in folder Can anyone help me in achieving this? 回答1: In general, you can't do that. Web pages do not have access to the local

ActiveX event handlers in an HTA using Javascript

大兔子大兔子 提交于 2019-11-27 06:38:39
问题 In C# I can write event handlers as follows: var wdApp = new Microsoft.Office.Interop.Word.Application(); wdApp.DocumentBeforeSave += (Document doc, ref bool saveAsUI, ref bool cancel) => { //do stuff here }; In VBA/VB6, I can use static event handling: Dim WithEvents wdApp As Word.Application Private Sub wdApp_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean) 'do stuff here End Sub I would prefer to use dynamic event handling. However, in Javascript, even when

Create COM/ActiveXObject in C#, use from JScript, with simple event

坚强是说给别人听的谎言 提交于 2019-11-27 03:26:25
问题 I'd like to create a COM object in C#, and use it via IDispatch from JScript. That part is pretty simple. I also want to implement simple callbacks on the COM object, similar to the event exposed by the XmlHttpRequest object that is usable in a browser. That model allows Javascript to attach event handlers like this: var xmlhttp = new ActiveXObject("MSXML.XMLHTTP"); xmlhttp.onReadyStateChange = function() { ... }; I want my client-side JScript code to look like this: var myObject = new

ASP.NET Cannot create ActiveX component

为君一笑 提交于 2019-11-26 23:29:30
问题 I have a ASP.NET application that allows users to export their staff's absences each month to Microsoft Excel. The application is currently generating the following exception Exception: Cannot create ActiveX component. with the following stack trace System.Exception: Cannot create ActiveX component. at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName) at HR.ManagerSummary.ExportToExcel() in H:\Development\pagec\Visual Studio 2005\Projects\HR\ysnet2\Time

How to close a HTA window from another HTA?

不问归期 提交于 2019-11-26 18:38:21
问题 I've tried to implement my own modal dialogs (Why?). I open a new window using WScript.Shell : dlg = shell.Run(dlgPath, 1, true); The line above creates a "semi-modal" HTA window. The script execution is stopped at this line, but the main window is still responsive. This issue is tackled within onfocusin eventhandler, which returns focus back to the new HTA window using shell.AppActivate() . This prevents even "Close Window" button to close the main window. However, in Windows7 there's a back

IE9, Automation server can't create object error while using CertEnroll.dll

无人久伴 提交于 2019-11-26 14:29:40
问题 In my web page, a JS block like this: var classFactory = new ActiveXObject("X509Enrollment.CX509EnrollmentWebClassFactory"); // Other initialize CertEnroll Objects It works fine in windows7(32bit or 64bit) with IE8(32bit) , as long as I change the IE8 secure setting, enable Initializing and Script ActiveX controls not marked as safe. But when use IE9(32bit), I try anything I can find on web, it reports error "Automation server can't create object." I even created a static html file, save it

Uncheck all checkboxes across entire workbook via CommandButton

久未见 提交于 2019-11-26 12:33:15
问题 I would like to have a code that unchecks all checkboxes named \"CheckBox1\" for all sheets across the workbook. My current code unfortunately doesn\'t work, and I\'m not sure why - it only works for the active sheet. Private Sub CommandButton1_Click() Dim Sheet As Worksheet For Each Sheet In ThisWorkbook.Worksheets Select Case CheckBox1.Value Case True: CheckBox1.Value = False End Select Next End Sub 回答1: This code iterates through all sheets ( except sheets named Sheet100 and OtherSheet )

FormData in IE8/9

雨燕双飞 提交于 2019-11-26 08:25:53
问题 i have implemented this script for uploading files with ajax, it works perfect in other browsers except for explorer, i noticed that formData is not supported by IE9 and less, are there any alternatives for formData in IE, and i want use clean javascript function doObjUploadExplorer(url, lnk_id, file, progress, success, content, frm, div_dlg, start_func){ var file_input = null, frm_data = new FormData(), req; try { //firefox, chrome, safari etc req = new XMLHttpRequest(); } catch (e) { //

ActiveXObject in Firefox or Chrome (not IE!)

拥有回忆 提交于 2019-11-26 00:29:13
问题 I am trying to create an ActiveXObject (to use FieSystemObject ) but it\'s only supported in IE. Is there a way I can make it work in Chrome or FF? I need to read all the files in a specific given folder, and list those. Well, is there another way to do it? 回答1: ActiveX is only supported by IE - the other browsers use a plugin architecture called NPAPI. However, there's a cross-browser plugin framework called Firebreath that you might find useful. 回答2: No for the moment. I doubt it will be