Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2007

Tip: Looking for answers? Try searching our database.

Export form to PDF -- parameter incorrect

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mpenkov - 28 Feb 2007 23:53 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.