Windows Develop Bookmark and Share   
 index > Windows Forms Designer > C# Web Browser/File Association - all within Windows Application
 

C# Web Browser/File Association - all within Windows Application

Hi,
I did search the Windows Forms forums here, and found a lot of file association stuff that pertains to the OS; that's not what I'm looking for.  I need the file association to stop while the user is using my windows form, but continue using the OS-recognized file association outside of my app.  I'm using MS Office Infopath in a hosted application, but for simplicity's sake, I'll use Word as an example in describing my problem.

I have a hosted webbrowser control that defaults to a sharepoint server document library.  I want the user to be able to click on a Word document in the library (a document named 'test 555.doc' for example), and when they click on the link, the url of that file, not the webbrowser's statustext field that says "Shortcut to test%20555.doc " (there is white space at the end of the statustext string), but the actual url of the file is returned to my application as a string for future use.

Here's the tricky part.  What happens is that even if I call a webbrowser1.stop() immediately after clicking, MS Word will still open.  I am trying to stop MS Word from opening, and essentially use the document url string to programatically open the word document in a rich text box (a text box only for argument's sake; I actually have a hosted InfoPath form control on another tab control that is programatically opening an *.xml document that the user clicked on). I am currently having trouble stopping the OS from automatically opening the stand-alone MS Word application, when I intend to handle the document my own way in my app.

I also am having trouble changing the webbrowser control's statustext from "Shortcut to test%20555.doc " into "http://server/folder/test%20555.doc"; I've even tried using a new string variable as a memory swap variable, and I still cannot use the .Replace(string,string) method on it. It won't change.

Any help, criticism, comments, or redirection to better sources of help would be greatly appreciated.

Thanks,
Josiah
Josiah Smith  Thursday, November 02, 2006 8:23 PM
For clarification, this may seem like a InfoPath or Office specific question, but it is not. I'm simply interested in temporarily (through code in my windows app) suspending the automatic filetype association between a hosted web browser and the OS.

Josiah
Josiah Smith  Thursday, November 09, 2006 9:41 PM

You can use google to search for other answers

Custom Search

More Threads

• Embedded control problem
• Windows XP Buttons Style
• Missing/worthless DragDrop args in designer
• All Controls disappear from [Designer] and more...
• can mdi form raise double click event?
• User control problem with Visible and Enabled
• making forms dynamic
• Can't add user control to form
• Visual Studio IDE Hangs with Databases that has several Master-Detail Tables....
• DataGridView Problem