| View previous topic :: View next topic |
| Author |
Message |
ernst_org General User

Joined: 04 Sep 2007 Posts: 38
|
Posted: Thu Mar 12, 2009 6:59 am Post subject: [solved] How do I clear all modules in a document |
|
|
Hi List I have made a document that I fill in with a lot of code when it is opende the first time, I would like to delete al modules after I have used them to prevent user getting problems and q from all the user,
How can I do that?
Last edited by ernst_org on Fri Mar 13, 2009 3:00 am; edited 1 time in total |
|
| Back to top |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2478 Location: Chonburi Thailand Asia
|
Posted: Thu Mar 12, 2009 8:19 am Post subject: |
|
|
First idea is not to store them in the document in question... _________________ Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs |
|
| Back to top |
|
 |
ernst_org General User

Joined: 04 Sep 2007 Posts: 38
|
Posted: Fri Mar 13, 2009 1:37 am Post subject: |
|
|
| But in this organisation you have to, there are 100 off different template and different rules and so on. |
|
| Back to top |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2478 Location: Chonburi Thailand Asia
|
Posted: Fri Mar 13, 2009 2:21 am Post subject: |
|
|
Ok, so ...
| Code: | oBLs = ThisComponent.BasicLibraries
oBL = oBLS.getByName( "Standard" )
oBL.removeByName( "Module1" ) |
deletes Module1 without question.
Does this help? _________________ Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs |
|
| Back to top |
|
 |
ernst_org General User

Joined: 04 Sep 2007 Posts: 38
|
Posted: Fri Mar 13, 2009 2:59 am Post subject: |
|
|
Thanks solved  |
|
| Back to top |
|
 |
MrBill1028 General User


Joined: 13 Sep 2008 Posts: 15 Location: COLORADO
|
Posted: Tue Jul 07, 2009 6:23 am Post subject: Getting Exception Error |
|
|
When I try to use this code I get an exception error or library not loaded error or variable not defined (I've tried several work a rounds) I'm trying to delete more then one module from different libraries within in the template. If I just use this code once it seems to work OK if I place several occasions of this code together to remove the rest of the modules it starts throwing errors. How would you use this to delete more then 1 module. Using Ooo 3.1 THANKS _________________ Rank Amateur Willing To Learn |
|
| Back to top |
|
 |
ernst_org General User

Joined: 04 Sep 2007 Posts: 38
|
Posted: Tue Jul 07, 2009 10:55 pm Post subject: |
|
|
I do like this, do not forget that you can“t delete your deletemodule. my module1
| Code: |
Sub RemoveHistory
on error goto rRemov_error
oBLs=ThisComponent.BasicLibraries
oBL = oBLS.GetByName("Standard")
oBL.removeByNAme("HelpText")
oBL.removeByNAme("Ini")
oBL.removeByNAme("Registry")
oBL.removeByNAme("zoom")
rRemov_error:
reset
exit sub
End Sub
|
|
|
| Back to top |
|
 |
|