View Full Version : Clearing the Contnet of all Application macros
lherz
09-26-2005, 04:12 PM
Is there a way to clear all application macro contents from within the VBP tool? I have a step that creates/populates macros at the beginning of the project via an XML file generated from a SQL query, but I would like to make sure that the macros are empty or non-existant prior to the step to populate them. This is not a critical issue, but in the event that there is an error with the macro population, some of the macros may contain incorrect data (from a previous run) and cause annoying error messages.
kinook
09-26-2005, 04:55 PM
Depending on what you mean by 'application macro contents', one of the following should work (in a Run Script action [VBScript sample code]):
Application.Macros(vbldMacroTemporary).Clear
Application.Macros(vbldMacroProject).Clear
Application.Macros(vbldMacroGlobal).Clear
lherz
09-26-2005, 05:08 PM
That helps, and I can work with that. It will take a bit of re-coding though.
What I was really looking for was a way to remove the values from all of the existing project macros, but leave the macros. (The code was originally written with macro.item to set the value instead of macro.add)
kinook
09-26-2005, 05:17 PM
For Each macro In Application.Macros(vbldMacroProject)
macro.Value = ""
Next
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.