Exporting to PDF - InfoPath Dev
in

InfoPath Dev

Exporting to PDF

Last post 07-09-2015 04:32 AM by grforber. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 07-09-2015 04:32 AM

    Exporting to PDF

    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

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.