Hi,
I'm trying to export my current InfoPath view to PDF with the code below and it works fine - I get a success message but the file doesn't actually save to the C:\ drive. Any suggestions?
Many thanks!
Gareth
Public Sub FormEvents_Submit(ByVal sender As Object, ByVal e As SubmitEventArgs)
'Declare our variable
Dim fileName As String
Dim nameNode As XPathNavigator
'Set the values. Replace "/my:myFields/my:textField" with the xpath to the field that has the value you want as the file name
nameNode = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:GER", NamespaceManager)
fileName = nameNode.Value + ".pdf"
'Do the work -- notice we use the variable fileName as part of the path for the file
Me.CurrentView.Export("C:\" + fileName, ExportFormat.Pdf)
e.CancelableArgs.Cancel = False