Dim defaultPrinter As String = "Microsoft Print to PDF"
Dim printerQuery As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_Printer")
For Each printer As System.Management.ManagementObject In printerQuery.Get()
If printer("Name").ToString().Equals(defaultPrinter) Then
printer.InvokeMethod("SetDefaultPrinter", Nothing)
Exit For
End If
Next
any if its cloud VM then may be the way might be little different…
If you have the mord macro…you can actually convert it into a vb code by including full name spaces…and then use invoke code itself to run the macro on word
Yes printers configured there, But we are getting error on on below class, I have imported necessary namespaces, still it is not working, I have macro on word which is working fine on my VDI, but again, how we can call it using Ui path is the issue