Thread: cell formatting
View Single Post
  #21   Report Post  
Darryl
 
Posts: n/a
Default

Success!

But one question. In the divide100 subroutine, it references Value1. If I
have three
form fields (value1, value2, value3) and I want to call divide100 onexit of
each, how
would I modify the divide100 (put a conditional test ?)

-Darryl

"Jean-Guy Marcil" wrote in message
...
Darryl was telling us:
Darryl nous racontait que :

I can send you the exact document as I might not answer properly. I
am using Word 2000


Ha! Word 2000! I had done all my tests in Word 2003. Protected documents
behave differently in almost all versions of Word...

Try this instead:

'_______________________________________
Sub Divide100()

Dim myValue As Single

ActiveDocument.Unprotect

With ActiveDocument.FormFields("Value1")
myValue = CSng(Left(.Result, Len(.Result) - 1))
myValue = myValue / 10000
.Result = CStr(myValue)

End With

ActiveDocument.Protect wdAllowOnlyFormFields, True

End Sub
'_______________________________________

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org