getElementById.contentDocument error in IE

The cross-browser equivalent to contentDocument (including Firefox itself, where contentDocument does work) is contentWindow.document. So try: alert(document.getElementById(‘iView’).contentWindow.document); contentWindow gets you a reference to the iframe’s window object, and of course .document is just the DOM Document object for the iframe. Here’s an article that summarizes better.

Open a folder using Process.Start

Have you made sure that the folder “c:\teste” exists? If it doesn’t, explorer will open showing some default folder (in my case “C:\Users\[user name]\Documents“). Update I have tried the following variations: // opens the folder in explorer Process.Start(@”c:\temp”); // opens the folder in explorer Process.Start(“explorer.exe”, @”c:\temp”); // throws exception Process.Start(@”c:\does_not_exist”); // opens explorer, showing some … Read more

Drag and drop to Desktop / Explorer

DragDrop.DoDragDrop can do this as long as you pass it an appropriate DataObject. First copy the files somewhere. You can use System.IO.Path.GetTempPath() if you don’t have anywhere better. Next create a string array containing the full paths to the files and do the following: string[] paths = …; DragDrop.DoDragDrop(this, new DataObject(DataFormats.FileDrop, paths), DragDropEffects.Copy); It is … Read more

Opening a folder in explorer and selecting a file

// suppose that we have a test.txt at E:\ string filePath = @”E:\test.txt”; if (!File.Exists(filePath)) { return; } // combine the arguments together // it doesn’t matter if there is a space after ‘,’ string argument = “/select, \”” + filePath +”\””; System.Diagnostics.Process.Start(“explorer.exe”, argument);

How add context menu item to Windows Explorer for folders [closed]

In the registration editor (regedit.exe) find: Context menu for right click on folders in left panel of Windows Explorer or on background of a directory in right panel: HKEY_CLASSES_ROOT\Directory\Background\shell if you are administrator HKEY_CURRENT_USER\Software\Classes\directory\Background\shell if you are a normal user Context menu for right click on folders in right panel of Windows Explorer: HKEY_CLASSES_ROOT\Directory\shell if … Read more