Click here to Skip to main content
15,922,325 members
Home / Discussions / C#
   

C#

 
QuestionHow to open the oledbObject of word document in PowerPoint application using C# Pin
sam_g19-Apr-06 21:03
sam_g19-Apr-06 21:03 
Questionhow to edit xml file Pin
rah_sin9-Apr-06 21:02
professionalrah_sin9-Apr-06 21:02 
AnswerRe: how to edit xml file Pin
papa19809-Apr-06 22:35
papa19809-Apr-06 22:35 
QuestionCatching new reminder and incoming mail Pin
Yevgeny Efter9-Apr-06 21:02
Yevgeny Efter9-Apr-06 21:02 
Questionbyte[] to String conversion problem Pin
wasife9-Apr-06 20:59
wasife9-Apr-06 20:59 
GeneralRe: byte[] to String conversion problem Pin
Guffa9-Apr-06 21:13
Guffa9-Apr-06 21:13 
QuestionHow to customize pdf viewer Pin
anurajju9-Apr-06 20:34
anurajju9-Apr-06 20:34 
QuestionCan events be hooked to MS Word? Pin
kbalias9-Apr-06 20:24
kbalias9-Apr-06 20:24 
I am opening a MS Word document using the following C# code.


Word.ApplicationClass WordApp = new Word.ApplicationClass();<br />
<br />
// Use the open file dialog to choose a word document  <br />
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)  <br />
{<br />
object fileName = openFileDialog1.FileName; <br />
	object readOnly = false;       <br />
	object isVisible = true;<br />
			<br />
//Here is the way to handle parameters you don't care about in .NET      <br />
	object missing = System.Reflection.Missing.Value;<br />
			<br />
	//Make word visible, so you can see what's happening        <br />
	WordApp.Visible = true;<br />
			<br />
	//Open the document that was chosen by the dialog      <br />
	Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing,ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible);<br />
			<br />
	//Activate the document so it shows up in front        <br />
	aDoc.Activate();<br />
}



This works fine and it opens the document in MS Word separate from the C# application. Is there a way of hooking an event to the document object (aDoc) so that when the word document is closed the C# application can react to the event?

Thanks
Kobus
QuestionCommon Task Control Pin
mehrdadc489-Apr-06 20:20
mehrdadc489-Apr-06 20:20 
AnswerRe: Common Task Control Pin
leppie10-Apr-06 1:38
leppie10-Apr-06 1:38 
AnswerRe: Common Task Control Pin
Graham Nimbley10-Apr-06 8:53
Graham Nimbley10-Apr-06 8:53 
Questiondata is not updating in Database Pin
Sunny H9-Apr-06 19:16
Sunny H9-Apr-06 19:16 
AnswerRe: data is not updating in Database Pin
Guffa9-Apr-06 20:52
Guffa9-Apr-06 20:52 
QuestionWhat is the fastest and Efficient way? Pin
pubududilena9-Apr-06 17:43
pubududilena9-Apr-06 17:43 
AnswerRe: What is the fastest and Efficient way? Pin
Guffa9-Apr-06 19:05
Guffa9-Apr-06 19:05 
AnswerRe: What is the fastest and Efficient way? Pin
Robert Rohde9-Apr-06 22:01
Robert Rohde9-Apr-06 22:01 
QuestionHOW TO Call the Save Method of an MDI Child Form from the MDI Form Toolbar Menu Pin
Old Gun9-Apr-06 17:03
Old Gun9-Apr-06 17:03 
AnswerRe: HOW TO Call the Save Method of an MDI Child Form from the MDI Form Toolbar Menu Pin
CWIZO9-Apr-06 21:01
CWIZO9-Apr-06 21:01 
QuestionDataGrid's Style (C# Windows Form) Pin
yagang9-Apr-06 16:42
yagang9-Apr-06 16:42 
AnswerRe: DataGrid's Style (C# Windows Form) Pin
yagang10-Apr-06 16:21
yagang10-Apr-06 16:21 
QuestionMethod Overloading Troubles Pin
Skoder9-Apr-06 16:35
Skoder9-Apr-06 16:35 
AnswerRe: Method Overloading Troubles Pin
S. Senthil Kumar9-Apr-06 18:15
S. Senthil Kumar9-Apr-06 18:15 
GeneralRe: Method Overloading Troubles Pin
Skoder11-Apr-06 16:15
Skoder11-Apr-06 16:15 
QuestionWant code fragment to move line around on Form Pin
...---...9-Apr-06 11:01
...---...9-Apr-06 11:01 
AnswerRe: Want code fragment to move line around on Form Pin
Guffa9-Apr-06 11:09
Guffa9-Apr-06 11:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.