need help

J

jpejakovic

I have found an interesting article on
http://support.microsoft.com/kb/302817/EN-US/ and before that I have
made a command button on office2003 toolbar using C#. Now I want to put
or get some text on current open document. In this sample that i have
found at Microsoft it creates a new instance of Word and then put a
text in document, but I need to put text in document if the Word is
active. How to do that?? What I need to change in this code:

private void button1_Click(object sender, System.EventArgs e)
{
object oMissing = System.Reflection.Missing.Value;
object oEndOfDoc = "\\endofdoc";

Word._Application oWord;
Word._Document oDoc;
oWord = new Word.ApplicationClass();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
..
..
..

}

Thnx.

Josip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top