Allows Microsoft Office Excel 2007 workbook files to be imported into InfoPath and converted into form templates.
Version Added: InfoPath 2007
For information on how to import a Office Excel 2007 workbook into Microsoft Office InfoPath 2007 using the InfoPath design user interface, see Convert an Excel workbook to an InfoPath form template.
The form template created as the result of the import process is not a single form template (.xsn) file. The folder specified by the
will contain the various form template files. Right-click the manifest.xsf file and click Design
, then save the form template as an InfoPath Form Template (*.xsn)
type. For more information about the form template files, see About Form Template Components
This interface, object, member or enumeration is provided by the InfoPath design environment. A reference must be set to the Microsoft Office InfoPath Designer 2.0 Type Library, located at C:\Program Files\Microsoft Office\Office12\IPDESIGN.DLL.
This object or member is used for extending the InfoPath application and is not intended to be used directly from your form code.
In the following example, an Office Excel 2007 document named "Data.xlsx" is imported as form template files to the "NewForm" folder in the temp folder on the local drive. This Visual Basic code requires a reference to the Microsoft Office InfoPath Designer 2.0 Type Library (IPDESIGN.DLL) and an Imports XDocsDesigner statement at the top of the form code.
Dim ConvertResult As String
Dim oConverter As XDocsDesigner.ExcelImporter = New XDocsDesigner.ExcelImporter
ConvertResult = oConverter.Import("c:\temp\Data.xlsx", "c:\temp\NewForm", False)
In the following example, a script is used to convert an Office Word 2007 document named "Name.docx" to form template files in the "NewForm" folder in the temp folder on the local drive.
// JScript source code
var oFileObject = new ActiveXObject("Scripting.FileSystemObject");
var strSourcePath = "C:\\temp\\Data.xlsx";
var strDestPath = "C:\\temp\\NewForm";
WScript.Echo("Creating the object...");
var oConverter = new ActiveXObject("InfoPath.DesignerExcelImport.2");
var strMessage = oConverter.Import(strSourcePath, strDestPath, true);
WScript.Echo("Error: " + e.message);
WScript.Echo("Result was: " + strMessage);