Isn’t it?Why do I have to hard code my field names.
I want to set the fields to blank ‘dynamically’, by taking the name of a RichText item, and then setting that to blank…
For now, I am just trying to do this, if the user has not attached anything. (hopefully, my user will agree to use Rich Text Lite fields instead, which avoids this problem coz you can make them so people can only enter attachments!)
But anyway…selected code:
Dim x As Integer
x = 0
Do While x <=3
'Item gets set correctly, I’ve seen it in debugger
If x=0 Then Set item = doc.GetFirstItem(“RGDocumentation1”)
If x=0 Then SOXtField = “RGDocumentation1”
'other lines of code here, then
'this code doesn’t work. Item name is set correctly to the field
'name but the field is not blanked out
If Isempty (item.EmbeddedObjects) Then
itemName = item.Name
Call uidoc.FieldSetText(itemName,“”)
doc.itemName=“”
Call uidoc.Refresh(True)
'If you do it like this instead, with hard coded field name then it works:
Call uidoc.FieldSetText(“RGDocumentation1”,“”)
doc.RGDocumentation1=“”
Call uidoc.Refresh(True)