Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Clearing the Contnet of all Application macros (https://www.kinook.com/Forum/showthread.php?t=1297)

lherz 09-26-2005 04:12 PM

Clearing the Contnet of all Application macros
 
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


All times are GMT -5. The time now is 10:43 PM.


Copyright © 1999-2023 Kinook Software, Inc.