Hi, I'm using VB2005 (still) and working in WinForms. I have a question that may be a little off topic on the NET side of the house, but its still VB related, so I'll ask it anyway in hope that someone can help.
I need to read a Registry Key from a Windows XP machine. Let's say I wanted to read the type of Default Printer that a computer is using. I would need to read something like:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device -- (I think this is where Windows keeps the "Default" printer from the Control Panel).
How would I do that?
Here's the part that is maybe off topic here...and very tricky!!!
I would like to add that code to an MS Word Document in the Macros section, where you can code in VB and have the document print the name of Default printer when it prints out a print job.
So, this is a two step question:
1). How would I read out of that Registry in VB.NET and print it out to say the console?
2). How would I add that code to the Macro's area of an MS Word Document and get the Word document to print out the name of the printer it used when it prints a print job?