General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Load XFT-Forms out of a XAC-file?

  • spyro

    Load XFT-Forms out of a XAC-file?

    Participants 2
    Replies 3
    Last Activity 13 years, 10 months ago

    Hi there,

    How do I call a XFT-Form that's not accessable as a single file? The XMetaL-plugIn for Visual Studio delivers a all-in-one-package with the extension “.xac”. Internally it seems to be a ZIP with all needed files except the DTD (e.g. the MCR-, TBR-, CTM-, RLX-, CSS-file and all included XFT-forms).

    While element-bound XFT-forms are loaded without problems it seems not possible to access them directly via a macro that is bound to a button.

    The Code

    [code]Set dlg=Application.CreateFormDlg(PATH/TO/FORM.xft”)

    doesn't work because the XFT is packed inside the XAC-file and can't be accessed by the file system. So, how could I call this form anyway?



    Derek Read

    Reply to: Load XFT-Forms out of a XAC-file?

    The XAC file is extracted before use by XMetaL Author and XMAX (at which point they read in all the files they contain pretty much as if you had created an “old style” customization with the CSS, CTM etc sitting beside the DTD), so you can reference it there.

    One way to do that is to use the API ActiveDocument.ResourceSet.Root to build the path, something like this:

    [code]Dim xftPath, dlg
    xftPath = ActiveDocument.ResourceSet.Root & “myform.xft”
    dlg = Application.CreateFormDlg(xftPath)

    Technically, the value of Root is the folder where the .ctm file is located.

    The alternative is to not use the XAC file and deploy your customization as separate files (DTD/RLX/RLS/RLD, CSS, CTM, MCR, XFTs), which are also created when you do a build in addition to the XAC file. Note that in this case the only file that is actually “compiled” is the MCR file, the rest of the files (CSS, CTM, etc) are really just copied over unmodified. In this case the same API is often useful, because you still need to provide CreateFormDlg with a full path.



    Reply to: Load XFT-Forms out of a XAC-file?

    Thank you! The solution with activedocument.ResourceSet.Root works like a charm.

    Rupert Jung



    Reply to: Load XFT-Forms out of a XAC-file?

    You can also add almost any other type of file to your project that you want; …… fxindex.htm files carry out the following basic steps: ….. Developer automatically creates a .xac file, which you can then copy using a …. For more information on how to use these methods to load


  • You must be logged in to reply to this topic.

Lost Your Password?