Need to place text in a FormField in a Word Document by C#

P

PTHRG

I need to place large text in a FormField. At this moment we use
TextInput.Default= .... but this input is limited to 256 characters.

We get a handle to the formfield by:
Microsoft.Office.Interop.Word.FormField FF =
document.FormFields.get_Item(ref spec_ff);
FF.TextInput.Default= "large text";

How can we solve this issue?
 
C

Cindy M.

Hi =?Utf-8?B?UFRIUkc=?=,
I need to place large text in a FormField. At this moment we use
TextInput.Default= .... but this input is limited to 256 characters.

We get a handle to the formfield by:
Microsoft.Office.Interop.Word.FormField FF =
document.FormFields.get_Item(ref spec_ff);
FF.TextInput.Default= "large text";

How can we solve this issue?
It's been a while since I last used this, but as I recall, there's no
way to assign that much text to the FormField.Result property. And
given that form fields are "deprecated", this won't change.

(You don't want to use TextInput.Default for this. This property is for
setting the "placeholder" text.)

You'll find a workaround on this page:
http://word.mvps.org/FAQs/MacrosVBA/SetLongFmFldResult.htm

It's VBA, but you shouldn't have any big problems "translating" it to
C#.

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