Copying text in text boxes into Microsoft Word

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gorstiedaghost
    New Member
    • Mar 2010
    • 1

    Copying text in text boxes into Microsoft Word

    Hi, atm i have a peice of code that will open microsoft word, and then copy text that it inside two speech marks. But instead of copying the text from the speech marks, i want to change the code to copy text from text boxes and put it into Microsoft Word instead.

    Code:
     private void BtnAutomateWord_Click(object sender, EventArgs e)
            {
                Word.Application objWord = new Word.Application();
                objWord.Visible = true;
                Word.Document objDoc;
                object objMissing = System.Reflection.Missing.Value;
                objDoc = objWord.Documents.Add (ref objMissing, ref objMissing, ref objMissing, ref objMissing);
                objWord.Selection.TypeText ("THIS WILL APEEAR IN WORD");
                objWord = null;
            }
    Cheers
    Matt
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    Is the text from the textbox not accessible through the textbox's .Text property?

    Comment

    Working...