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