Hi all,
I'm attempting to use the InfoPath form control to convert an InfoPath form
to PDF.
The conversion step is as follows:
public void DoConvert(string filename)
{
formControl1.XmlForm.CurrentView.Export(
filename,
ExportFormat.Pdf);
}
This previously worked fine with the MS Office 2007 Beta. I have since
installed the release of Office 2007, and now the code above throws a
System.ArgumentException. The message is: "InfoPath cannot export the form.
The parameter is incorrect".
Exports to other formats (ExportFormat.Xps and ExportFormat.Mht) also fail
with the same error message.
I'm compiling and running against the following DLLs:
Microsoft.Office.InfoPath.dll -- file version 12.0.4518.1014, assembly
version 12.0.0.0
Microsoft.Office.InfoPath.FormControl.dll -- file version 12.0.4518.1014,
assembly version 12.0.0.0
Does anyone have any ideas on what could be wrong?
Cheers,
Michael
S.Y.M. Wong-A-Ton - 01 Mar 2007 05:20 GMT
There are 3 things you can double-check:
1. Is filename being passed in the correct format?
2. Do you have a PDF/XPS add-in installed?
3. Do you have a reference to the Microsoft.Office.InfoPath namespace in
your WinForm?
For more information on the error, check out the doc here:
http://msdn2.microsoft.com/en-us/library/microsoft.office.infopath.view.export(V
S.80).aspx
---
S.Y.M. Wong-A-Ton
> Hi all,
>
[quoted text clipped - 29 lines]
> Cheers,
> Michael