Anybody have macro code for Word 2010 and above to determine if a specific printer is installed? I have a .DOT file that I created at the office and it sets office printers but I also use the file at home with a different printer. I tried using ONERROR to pass over the macro code that sets a printer, but it’s not really an error when it encounters the code to set the printer (at least I don’t think this is working). So, I thought I’d try to determine if the printer exists and bypass the set printer code if it doesn’t. Thanks!
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Word Macro to Determine if Specific Printer is Installed
Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Word Macro to Determine if Specific Printer is Installed
- This topic has 3 replies, 2 voices, and was last updated 8 years, 8 months ago.
Viewing 0 reply threadsAuthorReplies-
macropod
AskWoody_MVPSeptember 20, 2016 at 12:11 am #1578321Cheers,
Paul Edstein
[Fmr MS MVP - Word] -
WSrcbjr2
AskWoody LoungerSeptember 20, 2016 at 7:16 am #1578327Thanks. That is very helpful code. I ran across that yesterday and thought it was a bit complicated, but it does work great. I also ran across some suggestions here: http://www.ozgrid.com/forum/showthread/?t=10081. I combined the two a bit to come up with my test code to determine if the printer is installed.
However, I may have been overthinking this or asking the wrong question. I thought I needed to determine if a printer was installed before proceeding, but after messing around with all the above code I started thinking that maybe all I needed was something like this:
Code:If ActivePrinter = “\DTCHYB-NCCH008PRT22789-RIC5210” Then GoTo SkipPrinter Else GoTo SkipLoop End If
I think when I switch between office and home all I need to do is check to see if the above printer is the active printer. If it’s not, then I am home. I’m gonna try this later at home (at the office right now).
Thanks!
-Rich
-
macropod
AskWoody_MVPSeptember 21, 2016 at 1:49 am #1578424A key difference between your code and the code on the Pearson website, is that the latter tests which printers are installed (which is what you said you wanted to do), whereas your code only tests which printer is active. Testing which printers are installed allows you to make any one of them active. Thus, you might start off by testing the ActivePrinter and, if it’s not the one you want, test the installed set to see if it’s available and, if so, activate it, else do something different.
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Chrome Can Now Change Your Weak Passwords for You
by
Alex5723
11 minutes ago -
Microsoft: Over 394,000 Windows PCs infected by Lumma malware, affects Chrome..
by
Alex5723
1 hour, 18 minutes ago -
Signal vs Microsoft’s Recall ; By Default, Signal Doesn’t Recall
by
Alex5723
1 hour, 30 minutes ago -
Internet Archive : This is where all of The Internet is stored
by
Alex5723
1 hour, 42 minutes ago -
iPhone 7 Plus and the iPhone 8 on Vantage list
by
Alex5723
1 hour, 47 minutes ago -
Lumma malware takedown
by
EyesOnWindows
9 hours, 1 minute ago -
“kill switches” found in Chinese made power inverters
by
Alex5723
10 hours, 35 minutes ago -
Windows 11 – InControl vs pausing Windows updates
by
Kathy Stevens
10 hours, 29 minutes ago -
Meet Gemini in Chrome
by
Alex5723
14 hours, 34 minutes ago -
DuckDuckGo’s Duck.ai added GPT-4o mini
by
Alex5723
14 hours, 43 minutes ago -
Trump signs Take It Down Act
by
Alex5723
22 hours, 42 minutes ago -
Do you have a maintenance window?
by
Susan Bradley
9 hours, 51 minutes ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
54 minutes ago -
Cox Communications and Charter Communications to merge
by
not so anon
1 day, 2 hours ago -
Help with WD usb driver on Windows 11
by
Tex265
1 day, 7 hours ago -
hibernate activation
by
e_belmont
1 day, 10 hours ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
1 day, 14 hours ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
1 day, 17 hours ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
1 day, 17 hours ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
13 hours, 55 minutes ago -
Out of band for Windows 10
by
Susan Bradley
1 day, 22 hours ago -
Giving UniGetUi a test run.
by
RetiredGeek
2 days, 5 hours ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
2 days, 13 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
8 hours, 55 minutes ago -
Auto Time Zone Adjustment
by
wadeer
2 days, 17 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
2 days, 15 hours ago -
Manage your browsing experience with Edge
by
Mary Branscombe
14 hours, 46 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
1 day, 8 hours ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
8 hours, 24 minutes ago -
Apps included with macOS
by
Will Fastie
1 day, 12 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.