Word Automation with C#

  • Thread starter Thread starter Roger Zaugg
  • Start date Start date
R

Roger Zaugg

I've got a question about C# together with MS Word 2003.
I've got a C# applikation and I want to write any data into
Word. But how I can position this text without linebreaks.
I think it should work with a Textbox. And now the
question, how I can create a textbox in my C# - code and
position it in Word. (Without MSForms).
 
Roger,

You won't be able to do this. Word doesn't know about .NET control
types, it only knows about the controls that are in MSForms. If anything,
you will have to access this library (I believe it is in a separate library)
through COM interop, and add those elements.

Hope this helps.
 
Hi Nicholas,

Sorry, I will specify my question. I know that I can't
position a c# textbox in word, I will create a Wordtextbox
in Word from my C# Code. Is it possible without MSForms or
how I can do this?

thx for answer
-----Original Message-----
Roger,

You won't be able to do this. Word doesn't know about ..NET control
types, it only knows about the controls that are in MSForms. If anything,
you will have to access this library (I believe it is in a separate library)
through COM interop, and add those elements.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Roger Zaugg said:
I've got a question about C# together with MS Word 2003.
I've got a C# applikation and I want to write any data into
Word. But how I can position this text without linebreaks.
I think it should work with a Textbox. And now the
question, how I can create a textbox in my C# - code and
position it in Word. (Without MSForms).


.
 
Hi,

I got it... it's simple...
<worddocumentinstance>.shapes.addtextbox();

anyway.. thx for help
-----Original Message-----
Roger,

You won't be able to do this. Word doesn't know about ..NET control
types, it only knows about the controls that are in MSForms. If anything,
you will have to access this library (I believe it is in a separate library)
through COM interop, and add those elements.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Roger Zaugg said:
I've got a question about C# together with MS Word 2003.
I've got a C# applikation and I want to write any data into
Word. But how I can position this text without linebreaks.
I think it should work with a Textbox. And now the
question, how I can create a textbox in my C# - code and
position it in Word. (Without MSForms).


.
 
Back
Top