Thread: cell formatting
View Single Post
  #20   Report Post  
Jean-Guy Marcil
 
Posts: n/a
Default

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