Hi,
I am also working on some stuff similar to this. I want to access the word textbox in c#/asp.net application. There are two scenarios:
1) A machine which has VS2005 and MS Office 2000
The reference added for word is of version 9.0
and the code
aDoc.ActiveWindow.Document.Fields.Item(1).Locked = true;
works fine.
2) A machine which has VS2003 and MS Office 2003
The reference added for word is version 11.0
the same code as above doesnt work.
if we try accessing the data property as:
aDoc.ActiveWindow.Document.Fields.Item(1).Data;
It gives an error, "The field cannot contain data"
Can you please guide me as to how do I go about this.
What I want is access a word textbox, retrieve data from this and manipulate the same.
Thanks in advance
Venu M
Hi,
I got it... it's simple...
<worddocumentinstance>.shapes.addtextbox();
anyway.. thx for help
[color=blue]
>-----Original Message-----
>Roger,
>
> You won't be able to do this. Word doesn't know about[/color]
..NET control[color=blue]
>types, it only knows about the controls that are in[/color]
MSForms. If anything,[color=blue]
>you will have to access this library (I believe it is in a[/color]
separate library)[color=blue]
>through COM interop, and add those elements.
>
> Hope this helps.
>
>--
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
>"Roger Zaugg" <roger.zaugg@cbt.ch> wrote in message
>news:151e01c4bbfd$208ce0c0$a601280a@phx.gbl...[color=green]
>> 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).[/color]
>
>
>.
>[/color]