By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,960 Members | 987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,960 IT Pros & Developers. It's quick & easy.

Copying text in text boxes into Microsoft Word

P: 1
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.

Expand|Select|Wrap|Line Numbers
  1.  private void BtnAutomateWord_Click(object sender, EventArgs e)
  2.         {
  3.             Word.Application objWord = new Word.Application();
  4.             objWord.Visible = true;
  5.             Word.Document objDoc;
  6.             object objMissing = System.Reflection.Missing.Value;
  7.             objDoc = objWord.Documents.Add (ref objMissing, ref objMissing, ref objMissing, ref objMissing);
  8.             objWord.Selection.TypeText ("THIS WILL APEEAR IN WORD");
  9.             objWord = null;
  10.         }
Cheers
Matt
Mar 21 '10 #1
Share this Question
Share on Google+
1 Reply


jkmyoung
Expert 100+
P: 2,057
Is the text from the textbox not accessible through the textbox's .Text property?
Mar 22 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.