This topic explains how to get in a variable the selected folder id on the Send dialog box, independently of which button you click.
In the Send dialog box, the SpecifiedFolderId property gets and sets the folder id selected in the drop-down tree of folders, but won't give you the id of the "send on", "send back" and other buttons, optionally available on the dialog box.
On the following screenshot, besides the "send to" drop down tree (preceded by ?), there's also "send on" choice, preceded by the green right arrow.
The sendDialog.SpecifiedFolderId handles the id of the folder, selected in the drop-down tree of folders, ie. the "send to" folder id:
Dim sendDialog As New EditorialClient.SendCopyFlowDialog(Main.Window)
sendDialog.ObjectUIGroupName = Nothing
sendDialog.FolderObjectIds = selection.Ids
Select Case mode
Case "sendto"
sendDialog.SpecifiedFolderId = SystemUserOptions.Send_LastSendOnFolderId
sendDialog.IsShowSendHistory = True
sendDialog.IsShowSendSelected = True
If sendDialog.ShowDialog() = True Then
SystemUserOptions.Send_LastSendOnFolderId = sendDialog.SpecifiedFolderId
End If
In order to handle also other buttons, you need to add the code highlighted below, and then to use the DestinationFolderId. The DestinationFolderId covers all buttons, including the folder, selected in the drop-down tree of folders:
Dim sendDialog As New EditorialClient.SendCopyFlowDialog(Main.Window)
sendDialog.ObjectUIGroupName = Nothing
sendDialog.FolderObjectIds = selection.Ids
Select Case mode
Case "sendto"
sendDialog.SpecifiedFolderId = SystemUserOptions.Send_LastSendOnFolderId
sendDialog.IsShowSendHistory = True
sendDialog.IsShowSendSelected = True
If sendDialog.ShowDialog() = True Then
Dim selected As CopyFlowItemsControl.SendItem = sendDialog.SendItems.Find(Function(si) si.IsSelected)
Dim DestinationFolderId As Integer = 0
If selected IsNot Nothing Then
DestinationFolderId = selected.ContainerId
End If
SystemUserOptions.Send_LastSendOnFolderId = sendDialog.SpecifiedFolderId
End If