Foxtable(狐表)用户栏目专家坐堂 → word指定打印机 不能成功提交数据到打印机打印列表中


  共有7548人关注过本帖平板打印复制链接

主题:word指定打印机 不能成功提交数据到打印机打印列表中

帅哥哟,离线,有人找我吗?
cnsjroom
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1571 积分:11238 威望:0 精华:0 注册:2021/1/17 17:06:00
word指定打印机 不能成功提交数据到打印机打印列表中  发帖心情 Post By:2022/11/3 23:23:00 [只看该作者]

excel指定打印机代码:
Dim str As String = Args(0)
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(str)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
app.visible = True
'ws.PrintPreview
Ws.PrintOut(ActivePrinter:="Canon G2010 series")
app.quit

 

excel指定打印机   可以成功提交数据到打印机打印列表中

 

 

word指定打印机代码:
Dim str As String = Args(0)
Dim app As New MSWord.Application
Try
    Dim doc = app.Documents.Open(str)  '签名的文档
    doc.PrintOut(ActivePrinter:="Canon G2010 series")
    doc.close()
    app.quit()
Catch ex As Exception
End Try

 

word指定打印机  不能成功提交数据到打印机打印列表中

错误的事件名称自定义函数,word指定打印机
System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.MissingMemberException: 未找到类型“DocumentClass”的公共成员“PrintOut”。
   在 Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
   在 Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
   在 UserCode.A3tjprcY5gfbHW60O(Object[] Args)
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   在 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   在 Foxtable.UserFunctions.Execute(String Name, Object[] Args)
2022-11-03 23:22:25


 回到顶部