Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Export form to PDF -- parameter incorrect

56 views
Skip to first unread message

mpenkov

unread,
Feb 28, 2007, 6:53:25 PM2/28/07
to
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

unread,
Mar 1, 2007, 12:20:00 AM3/1/07
to
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(VS.80).aspx
---
S.Y.M. Wong-A-Ton

0 new messages