Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've been trying to Clear values from a Multi Box with a Macro. I can't use the Clear All function as I only want to clear some values contained in the Multibox.
I tried the following code but it only works on List boxes.
public function clearCycle()
set mb = ActiveDocument.GetSheetObject("MB07")
mb.Clear
end function
Is there anyway to achieve this?
You can't use the Clear Method to clear the selections in ListBox. This is because you can only use this method to clear the ListBox and Field. However, MultiBox is a logical object and works at the presentation layer. So you need to use the ClearMemberFields Method. Here is the code...
Sub Clear_MultiBox_Fields()
ActiveDocument.GetSheetObject("MB01").ClearMemberFields
End Sub
In the above code ClearMemberFields checks the Fields which are used in the MultiBox ("MB01") and then it clears the selections only for this MultiBox.
I hope this helps!
Cheers - DV
You can't use the Clear Method to clear the selections in ListBox. This is because you can only use this method to clear the ListBox and Field. However, MultiBox is a logical object and works at the presentation layer. So you need to use the ClearMemberFields Method. Here is the code...
Sub Clear_MultiBox_Fields()
ActiveDocument.GetSheetObject("MB01").ClearMemberFields
End Sub
In the above code ClearMemberFields checks the Fields which are used in the MultiBox ("MB01") and then it clears the selections only for this MultiBox.
I hope this helps!
Cheers - DV
use below code in control+M
sub clearCycle()
set mb = ActiveDocument.GetSheetObject("MB07")
mb.ClearMemberFields
end sub
see the attached file
select one item in multibox and then click on button
hope this help
Thanks to both of you, it worked perfectly.