[SOLVED] CAN macros work in standalone .ODT forms?

Howdy.

I’ve seen it declared several times on the web that macros “do not work” in standalone forms, most ostensibly when saving a Base form as an .ODT. Without having the time to verify the veracity of this claim, this seems to be the result of two possibilities:

  1. They really don’t. Any standalone .ODT that began its life as a Base form is doomed to be incapable of ever running BASIC. If this is the case, it could be characterized as an application design flaw, and naturally I’m having trouble believing this one.

  2. They would, it’s just that the macros simply aren’t exported along with the rest of the document - or they are, they’re just broken. Macros may exist and function within the Base form, but they don’t correctly carry over to the exported .ODT document (even if tried) because:

a) macros must be moved or copied from the database to the new .ODT via the Macro Organizer, with the probability that dependent links and code will be broken and need to be re-established or fixed, or

b) macros must be rebuilt wholesale in the new standalone document, even using different code according to differences with the new document’s format.

This problem represents a “chicken or egg” impasse while formulating a design strategy, and I want to be confident I’m not going to be foreclosed on functionality before I make a leap.

Anyone know the story here?

before you ask, standalone forms are required because of the recalcitrance of at least one user (the company owner), to the point in which the Base application must be uninstalled entirely from users’ machines, and the BASIC is necessary because of all the external scanned document image files that must be processed, normalized, stored and indexed (renaming files, per HIPAA, etc.) within the application.

If you create a standalone Writer .odt document by saving a Base form then macros will work. Macros work in Writer documents.

However there will not be any macros saved in the document. Macros are not part of a Form in Base so will not appear in the Writer document. If Macros are saved in a Module in the Base file you will need to copy the ones relevant to the form either to a Module created in the Writer document or into the My Macros module. If they were originally in My Macros in the Base project then they will be available to the Writer document. I find it best to store Macros in the Writer/Base file for portability.

The macros that work for the Form in Base may need to be modified to work in the Writer document. If you use “ThisDatabaseDocument” in your macros it has no meaning in a Writer document and will need to be replaced by “ThisComponent”. You may need to make other changes.

The OpenOffice Forum has a post relating to this here

Thank you for the refer - don’t know why my search didn’t catch that.

So, basically, all the macro work done within BASE would not be a total loss, even if porting them to the standalone forms will require some re-jigging.

Good to know.