I'm trying to use the Export to PDF function in InfoPath 2007. The file is
exported but the page layout is lost. That is to say the top and left
margins have disappeared and the individual pages are truncated at the last
piece of text (all the whitespace chopped off the top, left and bottom).
How do I tweak the settings on this facility? At the moment I have to
reprint everything to via Acrobat 7 to get a standard page size. The printed
pages are then centred in the page instead of top aligned as in the original
layout.
It is so close but I'm lost here. Help? Anyone?
H
Hello, Humphrey,
I note that you got no replies to your question. Did you ever work out how
to do it as I am now in the same situation as you. The export code seems to
allow for no setting of any page parameters. The code I am using is as
follows (strFileName is the file name returned from a SaveFileDialog)
CurrentView.Export(strFileName, ExportFormat.Pdf)
Cheers,
Alan Cossey
> I'm trying to use the Export to PDF function in InfoPath 2007. The file is
> exported but the page layout is lost. That is to say the top and left
[quoted text clipped - 7 lines]
>
> H
Humphrey - 30 Dec 2007 10:18 GMT
Alan,
No luck as yet. Could ask your indulgence to answer me one question? I
keep getting errors telling me that ".Export is not a member of CurrentView".
How did you get around this issue? I'm good with VBA but this InfoPath
scripting has me bamboozled.
H
> Hello, Humphrey,
> I note that you got no replies to your question. Did you ever work out how
[quoted text clipped - 19 lines]
> >
> > H
Alan Cossey - 30 Dec 2007 13:15 GMT
Hiya. Yes, I'm a VBA man too!
I'm using VSTA with VB as the language and have the following declared at
the top of the form code:
Imports Microsoft.Office.InfoPath
Imports System
Imports System.Windows.Forms
Imports System.Xml
Imports System.Xml.XPath
Imports mshtml
Imports System.io
All except the System.io were automatically generated and it is from
Microsoft.Office.InfoPath that CurrentView is descended (or whatever the .NET
jargon is). What happens if you type in
"Microsoft.Office.InfoPath.CurrentView." with the period/full stop on the
end? Does intellisense suggest Export as a method to you? What happens if you
select the word CurrentView and you hit F2?

Signature
Alan Cossey
> Alan,
>
[quoted text clipped - 28 lines]
> > >
> > > H
Humphrey - 31 Dec 2007 00:19 GMT
Alan,
That's the bit I'm missing. Both yield no results. Is there a
reference I need to set? Is there a manual tweak to point to the Export
routine? I can see what the issue is I just cannot correct it
H
> Hiya. Yes, I'm a VBA man too!
> I'm using VSTA with VB as the language and have the following declared at
[quoted text clipped - 47 lines]
> > > >
> > > > H
Alan Cossey - 31 Dec 2007 09:39 GMT
This is really a case of the blind leading the blind here, but if you would
like to zip up your file and send it to me at
alan@cossey58.freeserveDOTTTcoDOTTTuk I'll have a look at it. Would that help?

Signature
Alan Cossey
> Alan,
>
[quoted text clipped - 55 lines]
> > > > >
> > > > > H