Hidden Field = 0.00 Always??

A

Angyl

Working with form fields in Word.
I'm using some fields that I don't want to print so I've applied the hidden
attribute to them.

Problem is, whenever I apply the hidden attribute to them, they always
consider themselves ZERO. They're standard Text Fields set to be a number.
They work fine normally (2.5 is 2.5 when you tab out) but if I apply the
hidden text attribute (2.5 always becomes 0.00) when you tab out!

Any way to correct this little problem?
 
G

Greg Maxey

Hmm...AFAIK, about all you can do is set a range or ranges equal to the
cells containing the text you want to hide and then intercept the print
command to apply the hidden text format just before printing. I don't have
a working printer here at home so I can't test. You will want to reapply
normal text after the print. Since I can't test that I don't really know
the best way.

See: http://word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm

Something like:
Sub FilePrint()
Dim oTbl As Word.Table
Dim oStartPos As Long
Dim oEndPos As Long
Dim oRng As Word.Range
ActiveDocument.Unprotect
Set oTbl = ActiveDocument.Tables(1)
oStartPos = oTbl.Cell(1, 1).Range.Start
oEndPos = oTbl.Cell(2, 2).Range.End
Set oRng = ActiveDocument.Range(Start:=oStartPos, End:=oEndPos)
oRng.Font.Hidden = True
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True
End Sub
 
A

Angyl

Thanks, Greg.

Shame to have to go through so much trouble to fix a bug. Hopefully
Microsoft will take care of it in their next version of office...

I'm not holding my breath, though.
 
C

Charles Kenyon

I currently have forms that hide certain tables if they are not used.
Unfortunately it seems to be one-way. I haven't been able to reliably get
them unhidden again after printing so I have a rule that once you print, you
don't try to add data.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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