Finding values from ActiveX controls with automation (c#)

K

Koen

I have to create a word form but I want to use the control toolbox for the
form. Not the "regular formfields", because the appearence cannot be
customized like the "ocx controls" can.

The form has to be uploaded on an ASP.NET 2.0 website and the data has to be
extracted there. However I can't find a way to find the data that is entered
in the form fields. In VBA it is as simple as writing (in the ThisDocument
class module) eg:
MsgBox TextBox1.Text
.... but in C# with automation I can't fix it. VB.NET examples are fine as
well...

I am able to find the controls through the inlineshapes and fields
collections, but I can't find the values. I also don't wanna use VBA of any
kind because it might not work for everyone, or it could be disabled.

Also, if this is possible, is this approach for forms in word documents
compatible with Word 2000?
 
C

Cindy M.

Hi =?Utf-8?B?S29lbg==?=,
Also, if this is possible, is this approach for forms in word documents
compatible with Word 2000?
Yes, it should be. Although there's no guarantee that the Office 2000 IAs
will work the same as the PIAs. Also, please note that ActiveX controls in
Office 2000 were a LOT less stable than in earlier versions of Word. They
were introduced in Word 97 and had all kinds of "teething problems". Each
version has gotten a little better, but Word still doesn't particularly
"like" them.

See this discussion in the office.developer.automation newsgroup
C#: Reading a value of a checkbox created with the Control Toolbar

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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