Hello,
Thank you for your advice. I've created a sample Windows application
that performs the conversion, using the object model you have guided me
to.
The source, for anyone who is interested, goes along these lines:
private void btnConvert_Click(object sender, EventArgs e)
{
try
{
formControl1.XmlForm.CurrentView.Export(s_filenameOut,
ExportFormat.Pdf);
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex);
}
}
private void btnOpen_Click(object sender, EventArgs e)
{
try
{
formControl1.Open(s_filenameIn);
formControl1.XmlForm.CurrentView.ForceUpdate();
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex);
}
}
Fairly simple and convenient. This is in a Windows application. I
have a question:
Is it possible to do this from the command line? All the articles I've
come across relate to the Microsoft.Office.InfoPath.FormControl object,
which is a Windows form component. I'm unable to use it from a command
line application. Is there a way I could do this?
Thank you for your help.
Cheers and regards,
Misha
> Get the object model poster for InfoPath 2007 here:
> http://www.microsoft.com/downloads/details.aspx?FamilyId=771AEB45-9D27-4D1F-ACD1
-9B950637D64E&displaylang=en
[quoted text clipped - 13 lines]
> > Cheers and regards,
> > Misha
S.Y.M. Wong-A-Ton - 06 Oct 2006 07:29 GMT
I haven't tried it before, so I wouldn't know. Regarding articles: Remember
that InfoPath 2007 is still in beta, so it is early to expect to see many
articles on the product.
---
S.Y.M. Wong-A-Ton
> Hello,
>
[quoted text clipped - 60 lines]
> > > Cheers and regards,
> > > Misha
RickH - 28 Nov 2006 07:30 GMT
Anything you can run as a batch you can run as a Windows program, and
gain flexibility...
Unfortunately, I have to use Infopath 2003 to convert a bunch of
Infopath Report views into a PDF or Word document.
Right now, I export from Infopath to a MHT file. Then I open it in IE
and use Acrobat to convert to PDF.
Takes forever to combine about 30 Infopath views to one large PDF file.
And I have several EOY reports like this to do.