<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: Set Default printer - Blueprism in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72959#M25564</link>
    <description>Thanks a lot, It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 08 Mar 2021 09:15:00 GMT</pubDate>
    <dc:creator>HemalathaPolasa</dc:creator>
    <dc:date>2021-03-08T09:15:00Z</dc:date>
    <item>
      <title>Set Default printer - Blueprism</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72957#M25562</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Do anyone have the code stage that have been already developed for choosing the default printer or else can you suggest me what would be the best way to do?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Sun, 07 Mar 2021 19:43:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72957#M25562</guid>
      <dc:creator>HemalathaPolasa</dc:creator>
      <dc:date>2021-03-07T19:43:00Z</dc:date>
    </item>
    <item>
      <title>RE: Set Default printer - Blueprism</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72958#M25563</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I've never deployed to Production, but this code will work:&lt;BR /&gt;(Beforehand add "System.Management.dll" to External References and "System.Management" to Name Space Imports.)&lt;BR /&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;' pn is an Input Parameter, which is the printer name to set as default.

If pn = "" Then
	return
End If

Dim mos As New ManagementObjectSearcher( _
	"SELECT * FROM Win32_Printer")
Dim moc As ManagementObjectCollection = mos.Get()
Dim mo As ManagementObject
For Each mo In moc
	If CStr(mo("Name")) = pn Then
		Dim mbo As ManagementBaseObject = _
			mo.InvokeMethod("SetDefaultPrinter", Nothing, Nothing)
		Dim ret As Long = Convert.ToInt64(mbo("returnValue"))
		If ret &amp;lt;&amp;gt; 0 Then
			Throw New Exception("Failed to set default printer.")
		End If
		return
	End If
Next mo

Throw New Exception("Printer not found.")​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;I hope this will help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Kota Suto&lt;BR /&gt;Japan&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 01:23:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72958#M25563</guid>
      <dc:creator>KotaSuto1</dc:creator>
      <dc:date>2021-03-08T01:23:00Z</dc:date>
    </item>
    <item>
      <title>RE: Set Default printer - Blueprism</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72959#M25564</link>
      <description>Thanks a lot, It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Mar 2021 09:15:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72959#M25564</guid>
      <dc:creator>HemalathaPolasa</dc:creator>
      <dc:date>2021-03-08T09:15:00Z</dc:date>
    </item>
    <item>
      <title>RE: Set Default printer - Blueprism</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72960#M25565</link>
      <description>&lt;P&gt;Hi Kota ,&lt;/P&gt;
&lt;P&gt;Hope you are doing good, Do you know how to set network printer as default?&lt;/P&gt;
&lt;P&gt;The Code is able to set default only which are available in windows&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Raja Sekhar Reddy Palam&lt;BR /&gt;Automation Analyst&lt;BR /&gt;Gateshead Health NHS Foundation Trust&lt;BR /&gt;Gateshead&lt;BR /&gt;07852757441&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Oct 2023 09:00:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Set-Default-printer-Blueprism/m-p/72960#M25565</guid>
      <dc:creator>raja2407</dc:creator>
      <dc:date>2023-10-31T09:00:00Z</dc:date>
    </item>
  </channel>
</rss>

