473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

add printer vbscript, what's the code for vb.net?

Hi everyone...very, very amatuer programmer here.

I am making a small application to add a network printer. I have a vb script that does so...here is the code I have..
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\server\printer"
I have scoured the web, trying to see if there way I can do this same task as part of an event in vb.net

I'm not having much luck, mostly because of my level of knowledge in .net. I've downloaded the WMICodeCreater from Microsoft...one would think you could plug in the code it generates like it says...but I'm not having any luck.

Any thoughts would be greatly appreciated.
Jan 30 '08 #1
1 3601
Nevermind, I'm an idiot. Needed to change Set to Dim.

How I passed intro to Vb is anyone's guess.
Jan 30 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Patrick Herb | last post by:
Hello, I'm trying to print the content of a RichTextBox from my VB 6 app. What I want is that the CommonDialog shows up, the user selects a printer and the content of the RichTextBox prints to...
1
by: Paul White | last post by:
I've written a POS system for a client, but we're having problems with the customer receipt printing. The printer has a left margin gap of about 1 inch. I need to reduce that left margin width in...
1
by: James | last post by:
how come when i print programicly my printer says "data received" and it won't print until i press the GO button on the printer? my printer is a HP laser jet 5 Set objFS =...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
0
by: ykffc | last post by:
I have written some vbscript in ASP. The ASP code can access all Printer data correctly but when it tries to control the printer, such as pausing, resuming print, it does nothing. The written...
3
by: Giovanni Benedetti | last post by:
Hi everybody, sorry for my English first of all. I've an ASP page (ASP 3.0) used on an intranet which fill up some particular Mail sheets getting data from a database. Those pre-compiled sheets...
5
by: itfetish | last post by:
I have made an electronic sign out book for my office in ASP using VBScript. Problem is, when there is a fire we need to check who is out and who is burning. I have been trying to think of how...
3
drhowarddrfine
by: drhowarddrfine | last post by:
I have a simple vbscript that extracts a web page, saves it to a file, then uses notepad to print that file to the default printer. What can I do to make it print to a specified non-default printer?...
8
drhowarddrfine
by: drhowarddrfine | last post by:
I have a simple VBScript that goes on the 'net, fetches a page from a specific URL, and prints it on the default printer. The problem is I need that page to print on the secondary printer. VBScript...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.