Windows 7 在Windows 7上通过网络将VB6打印到Zebra打印机
我继承了将装运标签打印到Zebra s600打印机的代码,虽然该代码在Windows XP中运行良好,但我不明白为什么它在Windows 7中不起作用 在Windows 7中运行该程序时出现以下错误: 运行时错误“75”路径/文件访问错误 但它在WindowsXP中运行,因此路径没有错 编辑:我尝试过在可比模式下运行,同时右键单击并以管理员身份运行该程序。还是不行Windows 7 在Windows 7上通过网络将VB6打印到Zebra打印机,windows-7,printing,vb6,Windows 7,Printing,Vb6,我继承了将装运标签打印到Zebra s600打印机的代码,虽然该代码在Windows XP中运行良好,但我不明白为什么它在Windows 7中不起作用 在Windows 7中运行该程序时出现以下错误: 运行时错误“75”路径/文件访问错误 但它在WindowsXP中运行,因此路径没有错 编辑:我尝试过在可比模式下运行,同时右键单击并以管理员身份运行该程序。还是不行 Sub PrintLabel() '**** this sub print a barcode label on the Zebra
Sub PrintLabel()
'**** this sub print a barcode label on the Zebra S600 printer
'**** for the cardboard shipping box.
Dim mySNprinter As String
mySNprinter = GetSetupVariable("TestSnPrinter")
If (mySNprinter = "") Then
mySNprinter = "\\dc1\bertha"
End If
Open mySNprinter For Output As #3
Print #3, "^XA" 'start of data
Print #3, "^LH20,25" 'home position of label is 5,25
If optSize(0).Value = True Then
Print #3, "^FO1,30^A0,N,25,25^FD" & cboLabel.Text & "^FS" 'print MP-1 with the D font
End If
If optSize(1).Value = True Then
Print #3, "^FO1,30^A0,N,35,35^FD" & cboLabel.Text & "^FS" 'print MP-1 with the D font
End If
If optSize(2).Value = True Then
Print #3, "^FO1,30^A0,N,50,50^FD" & cboLabel.Text & "^FS" 'print MP-1 with the D font
End If
Print #3, "^XZ" 'end data
Close #3
您在哪一行收到该错误?您是否尝试右键单击exe并以管理员身份运行?是的,我尝试以管理员身份运行,但在第一行Print 3上出现错误,^X共享/打印机名称是否有效,是否可从Windows 7计算机访问?仅仅因为它在一台机器上工作并不意味着它在另一台机器上工作……是的,当我在设置中将它设置为默认设备时,它将在机器上打印文本。虽然我不能像上面的代码那样发送特殊命令