hidden text formfield

R

rmanchu

hi guys

i've got a hidden text formfield. i've set word to display hidden text
so the field is visible.

when i enter text into it and exit, i set a sub to display the contents
in a msgbox. however, the text returned is empty! checking the length
of the returned text returns 0. if unhide the text formfield then the
same code displays the text.

is this expected behavior?

thanx
riyaz
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
hi guys

i've got a hidden text formfield. i've set word to display hidden text
so the field is visible.
OK

when i enter text into it and exit, i set a sub to display the

So it is not hidden, right?
contents in a msgbox. however, the text returned is empty! checking
the length of the returned text returns 0. if unhide the text

???
Now it is hidden?
How do you enter text in a hidden formfield?

Your description is confusing...

Also, posting the code you use would help us help you!
formfield then the same code displays the text.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
R

rmanchu

Your description is confusing...

hmm. i don't think so, but i'll say it again.

1) i've set word to display all hidden text.
2) i've got a hidden text formfield with data in it.
3) if the text formfield is hidden the data entered into it cannot be
extracted using : ActiveDocument.FormFields("myfield").Result
4) i assume that text entered into a hidden field will be hidden?
5) if i unhide the text formfield then the same code returns the text
entered

this behavior seems inconsistent as dropdown/checkbox formfields
eventhough they r hidden, return the values correctly.

thanx
riyaz
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
hmm. i don't think so, but i'll say it again.

1) i've set word to display all hidden text.
2) i've got a hidden text formfield with data in it.
3) if the text formfield is hidden the data entered into it cannot be
extracted using : ActiveDocument.FormFields("myfield").Result
4) i assume that text entered into a hidden field will be hidden?
5) if i unhide the text formfield then the same code returns the text
entered

this behavior seems inconsistent as dropdown/checkbox formfields
eventhough they r hidden, return the values correctly.

In my Word version (Word 2003, SP2), whether the hidden text is displayed on
screen or not has no bearings on the result: the code always returns an
empty string. But there is a way around this:

Dim FormText As Range

Set FormText = ActiveDocument.FormFields("Text1").Range
FormText.TextRetrievalMode.IncludeHiddenText = True

MsgBox FormText.Text

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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