Hi,
I have an action button that adds values to fields in a document based on a dialog box appearing...the document goes from read mode, to edit mode and then read mode...but the sections in the document are not expanding when my last statement is
uidoc.expandallsections...i thought this statement overided the fom/section properties..
for some reason the sections are expanded when in edit mode but then it closes the sections once my code has finished.
What am i doing wrong in my code: Code is below
Thanks in advance
Nadeem Shaikh
My Code:
Sub Click(Source As Button)
Dim session As New notessession
Dim user As String
user = session.UserName
Print "Started Add & Remove process on " & Str$(Now())
Print "Implemented by " & user
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set uidoc = workspace.CurrentDocument
Set currentdb = session.currentdatabase
Set currentdoc = uidoc.Document
uidoc.EditMode = True
Call session.SetEnvironmentVar( "ERole", "ACO" )
Call session.SetEnvironmentVar( "EAddRemove", "Add" )
'+++++++++Call Dialog Box+++++++++++++++++++++++++++++++++++++++++++
Call DialogList("StaffMovDlg", "Add ACO Staff Member")
If Response1 = False Then
uidoc.EditMode = False
End
End If
'+++++++++Call Dialog Box+++++++++++++++++++++++++++++++++++++++++++
Set item1 = tempdoc.GetFirstItem( "SMAddRemove" )
Set item2 = tempdoc.GetFirstItem( "SMStaffName" )
Set item3 = tempdoc.GetFirstItem( "SMStaffRole" )
Set item4 = tempdoc.GetFirstItem( "SMCurrDivTeam" )
'+++++++++Get Item value+++++++++++++++++++++++++++++++++++++++++++
Dim NormalName As New NotesName(tempdoc.SMStaffName(0))
TName$ = NormalName.Abbreviated
Dim item As NotesItem
Forall vals In item3.Values
Set item = currentdoc.GetFirstItem( "DivACPO" )
End Forall
itemName = item.Name
'+++++++++Get Item value+++++++++++++++++++++++++++++++++++++++++++
'+++++++++Add+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Set item = currentdoc.ReplaceItemValue( "DivACPO", tempdoc.SMStaffName(0) )
'+++++++++Add+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Call currentdoc.Save( True, True )
Call uidoc.Reload
uidoc.save
uidoc.EditMode = False
'++++++++Compose Change Control Doc++++++++++++++++++++++++++++++++++++++++
Call ComposeChangeCDoc
Dim changeview As NotesView
Set changeview = currentdb.GetView( "ChgCtrlV" )
Call changeview.Refresh
Print "Staff to Add: " & tempdoc.SMStaffName(0)
Print "Staff Role: " & tempdoc.SMStaffRole(0)
Print "Staff Division: " & tempdoc.SMCurrDivTeam(0)
Print "No of Change Control Docs Created: " & Cstr(count7)
Call uidoc.ExpandAllSections
End Sub

expandallsections not done (Nadeem Shaikh 16.Jun.04)
. . 