Word 2003 FormFields

  • Thread starter Thread starter Vb
  • Start date Start date
V

Vb

Hello,

Does anyone knows how to erase the value of a FormField in Word with Office
2003?

When I am using the code as membered (sending an empty string) below I get
an error and the FormField is still having it's value.

'= BEGIN CODE
Public Function WriteDocFds(iBookMrkNm, iVal) 'Office2003
On Error GoTo errHandler

Set ffield = ActiveDocument.FormFields(iBookMrkNm).TextInput

If ffield.Valid = True Then
If iValue <> "" And iValue <> " " Then
ffield.Default = iVal
Else
If iVal = "" Then ffield.Default = " " 'HERE I AM
USING SPACE TO EMPTY IT BUT SOMETIMES IT REALLY
NEEDS TO BE EMPTY
End If
End If

Exit Function

errHandler:
Select Case Err.Number
Case 438
'NOTHING
Case 4198
'NOTHING
Case 5101
'NOTHING
Case 5941
'NOTHING
Case Else
MsgBox "WriteDocuFields" & vbCrLf & Err.Description, vbCritical,
"Fout#: " & Err.Number
End Select
End Function


'= END CODE
Thanks a lot in advance!

VBA-er
 
Sorry, this newsgroup is for Microsoft Access, the database product.
You need to ask in a newsgroup for Microsoft Word. Also, tell them what
the error /was/. There's no point saying you got an error, unless you
tell them what it was!

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
Back
Top