Hi,
I am trying to hide rich text field using section. The below code is written on PostOpen event.
On Error Goto ErrorHandler
Set doc = Source.Document
Set rti = doc.GetFirstItem("Excess_Attachments")
Set rtnav = rti.CreateNavigator
Set rts = rtnav.GetElement
If Source.FieldGetText("Business_Segment") = "Excess" Or Source.FieldGetText("RTF") = "True" Then
'Call Source.ExpandAllSections
rts.IsExpanded = True
Else
'Call Source.CollapseAllSections
rts.IsExpanded = False
End If
Call Source.Refresh(True)
ErrorHandler:
Messagebox "Error" & Str(Err) & ": " & Error$
When I open a document I get error msg ‘Position is not valid’. Why do I get this message and how to rectify it?