Printing the INFOPATH Form 2003 using VB Script - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Printing the INFOPATH Form 2003 using VB Script

Last post 05-08-2009 06:18 AM by smate. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-08-2009 06:18 AM

    • smate
    • Not Ranked
    • Joined on 04-23-2009
    • Posts 6

    Printing the INFOPATH Form 2003 using VB Script

    I am trying to create a PDF file using the printer macro, I am getting error expected statement. Code attached below. 

     

    Sub Print_OnClick()

    ' Write your code here

    Dim fileName1

    Dim nameNode1

    'Set the values. Replace "/my:myFields/my:textField" with the xpath to the field that has the value you want as the file name

    nameNode1 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:LabNumber", NamespaceManager)

    fileName1 = nameNode1.Value + ".pdf"

    ActivePrinter = "PDF995"

    Application.PrintOut FileName:=fileName1, Range:=wdPrintAllDocument, Item:= wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, Collate:=True, Background:=True,

    PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0

    End Sub

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