kjacob318
03-10-2016, 09:28 AM
Hello, I am trying to write a maco that will help clear a form that I created. I have most of it but am getting stuck trying to clear a list box and uncheck all checkboxes. Below is the code I have.
What I need help with is clearing the "Plant" listbox and unchecking the check boxes Receive, RMA, BER and Other. I have two options I've tried and nothing is working! Does anyone have any idea to help make this work?
ActiveDocument.SelectContentControlsByTitle("Date of Submission")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("MDN/DSN")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("Plant")(1).SetPlaceholderText , , "Choose an item." ' I want to be able to reset this to the default value
ActiveDocument.SelectContentControlsByTitle("Bin Location")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("CPN/MPN")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("PO/RO #")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("Receive")(1).SetUncheckedSymbol
ActiveDocument.FormFields("RMA").CheckBox.Value = False
ActiveDocument.FormFields("BER").CheckBox.Value = False
ActiveDocument.FormFields("Other").CheckBox.Value = False
What I need help with is clearing the "Plant" listbox and unchecking the check boxes Receive, RMA, BER and Other. I have two options I've tried and nothing is working! Does anyone have any idea to help make this work?
ActiveDocument.SelectContentControlsByTitle("Date of Submission")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("MDN/DSN")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("Plant")(1).SetPlaceholderText , , "Choose an item." ' I want to be able to reset this to the default value
ActiveDocument.SelectContentControlsByTitle("Bin Location")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("CPN/MPN")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("PO/RO #")(1).Range.Delete
ActiveDocument.SelectContentControlsByTitle("Receive")(1).SetUncheckedSymbol
ActiveDocument.FormFields("RMA").CheckBox.Value = False
ActiveDocument.FormFields("BER").CheckBox.Value = False
ActiveDocument.FormFields("Other").CheckBox.Value = False