Home Forums General XMetaL Discussion Load Access Forms in XMetaL? Reply To: Load Access Forms in XMetaL?

Derek Read

Reply to: Load Access Forms in XMetaL?

I'm not sure exactly what you need (more details would help), but there is a sample macro included with the Journalist demo that imports data from an Excel file. It might be useful to look at. It uses ODBC so the same could be done for other data sources.

Assuming you have XMetaL Author Essential or Enterprise 5.5:

1) Help > Samples > Journalist Sample Files.
2) The file CamerasInFocus.xml should open.
3) Open the Macros toolbar and run the macro called “Import Table” or open the “Journalist 2” toolbar and click the button “Import Database Table”. A dialog will appear and the default settings should all be set properly to import data from a sample Excel file.
5) Click “OK” to use these default settings. The data will be inserted into a table in the CamerasInFocus.xml document.

There are lots of things that occur to make this work. The macro “Import Table” is included in the journalist.mcr file located in the Macros folder of your XMetaL Author installation. Many of the things it does could be done differently to give similar or very different results and you have complete control over what ultimately gets inserted, though you have less control over the format of what gets written to disk (a temp file), which you can play with on the “Output Format” tab. That means that if what ends up being written to disk is wildly different from what you need to insert you will need to do some parsing before insertion (or perhaps some additional massaging of the document after or during insertion).

The Programmer's Guide topic relevant to this discussion is called “The Import Database dialog box”.

An alternative idea would be to use something like Microsoft's ADODB instead (we have no example of this).