Ask Your Question
0

Saving macros and toolbars in Writer templates

asked 2015-08-04 17:20:06 +0200

Ike Boffo gravatar image

updated 2015-08-23 18:20:41 +0200

Alex Kemp gravatar image

I'm using the latest version of Writer ( 4.4.5.2). I create documents in .odt format based upon templates with custom styles. I want to use macros to apply direct formatting to change text color, which I do on a temporary basis while I review content. I want to create a custom toolbar with controls to add the formatting (fire the macro). I've managed to do this at the LibreOffice level, but never with a template, which is what I want to do, since I don't need this stuff in all of the documents I work with.

My questions are these:

If I want the macros to apply to every .odt created using my template, can I record the macros in the template and have them available to new documents as well as existing documents based upon that template the next time I open them?

If I save macros anywhere, what is the difference between saving them in a library and a module?

Can I create a custom toolbar that appears only for documents based upon my template?

edit retag flag offensive close merge delete

Comments

the primary difference I have seen is whether they travel with the document or instead must be installed to new machines separately in an oxt or by similar method.

doug gravatar imagedoug ( 2015-08-04 19:33:28 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2015-08-04 20:38:54 +0200

pierre-yves samyn gravatar image

Hi

In addition to doug's response:

  1. You can record macros in a template and have them available to new documents as well as existing documents based upon that template the next time you open them.
  2. Principle is to save macros in a place accessible to the template... If macros are eg. in a library installed by extension, the advantage is that the user does not has to validate the execution of macros when opening the document. Reminder: this execution depends on Tools Options LibreOffice Security Macros security
  3. You can create a custom toolbar that appears only for documents based upon the template.

See MyToolBar.ott: select "foo" and click a button in the custom toolbar

Regards

edit flag offensive delete link more

Comments

I can see that you've done what I was trying to do.

What location would be accessible to the template? Where should I save my macros? I've created a library in the template (editing the .ott) and saved the macros there, but when I open a document based upon that template, the macros are not available in that file. The toolbars as well.

Ike Boffo gravatar imageIke Boffo ( 2015-08-05 15:41:43 +0200 )edit

Just to be sure we understand each other: I wrote that macros and toolbars are available in documents created from the template. I wanted to say documents created from the template already including macros and toolbars. They are not available for documents created before the creation of macros.

pierre-yves samyn gravatar imagepierre-yves samyn ( 2015-08-05 17:22:53 +0200 )edit

A-HA! That's the problem! :-) Many thanks.

Ike Boffo gravatar imageIke Boffo ( 2015-08-05 18:44:17 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-08-04 17:20:06 +0200

Seen: 467 times

Last updated: Aug 04 '15