Home Forums General XMetaL Discussion xft form – Getting ActiveDocument is undefined Reply To: xft form – Getting ActiveDocument is undefined

XMetaLOldTimer

Reply to: xft form – Getting ActiveDocument is undefined

This macro is using the “advanced” way of running an XFT form versus the simply way via Application.CreateFormDlg API.  When using the advance way, you need to inject all top-level objects referenced by the script contained within the .xft form.  The simply way automatically injects Application, ActiveDocument, Selection, Documents, and ResourceManager for you.  Try changing the macro like this:

        var XftCtrl = new ActiveXObject(“XF.XFTForm”);
        XftCtrl.AddTopLevelObject(“ActiveDocument”, ActiveDocument);
        nonmodalDlg = XftCtrl.StartForm(“C:\Doczone\Forms\xRefErrs.xft”, 0);

Regards,
Addam

Reply

Products
Downloads
Support