Home › Forums › General XMetaL Discussion › xft form – Getting ActiveDocument is undefined › Reply To: xft form – Getting ActiveDocument is undefined
Reply to: xft form – Getting ActiveDocument is undefined
May 15, 2014 at 8:29 pmThis 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