-
WSharrella
AskWoody LoungerHey, I understand. When I posed this to my boss, he also had BIG security concerns. What I was thinking of was that since I have certain Admin rights, whenever I send an e-mail triggering a script to run, I wanted it to have MY rights to run, and not the default rights of the service that read the e-mail …. Long story, won’t bore you w/details, but suffice to say that I have to go another route and see about how to authenticate e-mail senders ……
Thanks for the reply anyway!
Andrew
-
WSharrella
AskWoody LoungerI’m new to alot of this, but couldn’t you just create a temp file once the program is running and then delete the temp file before exiting the pgm. Have code to check to see if temp file exists — If so, exit pgm …
Make sense?
Andrew Harrell
very newbie VB programmer -
WSharrella
AskWoody LoungerAugust 2, 2002 at 12:25 pm in reply to: Error checking on Active Directory getobject (VB/VBScript) #605635first, thanks to all who took time to look at this for me …
Rory, I’ll give your syntax a try, but I suspect that will not do anything. I’m thinking that the script dies on the getobject line. As a test, I put a msgbox right after the getobject line (no conditional code). It never displayed the msgbox, it just halted execution of the script. Arrgh!!! I wonder if there is a way to test before doing the getobject — some kind of object.exists ….
I’ll keep working at it and if I come up with anything I will post it … thanks
-
WSharrella
AskWoody LoungerAugust 1, 2002 at 5:36 pm in reply to: Error checking on Active Directory getobject (VB/VBScript) #605494nothing — the MsgBox does not come up at all.
Could this be something to do with the fact I’m dealing with an object , and therefore I might have to do some kind of test with vbObjectError and do an Err.Raise? I’m starting to wonder if the getobject call is doing something on the server side (calling to Active Directory), and the server is passing back an error that kills the script on the getobject call. Does that make any sense?
I’m just kinda groping here …. thanks
-
WSharrella
AskWoody LoungerJuly 31, 2002 at 11:46 am in reply to: Error checking on Active Directory getobject (VB/VBScript) #605167Gave the ” If objUser Is Nothing then …” a test, but no dice — same as before.
Anything else to try? Again, thanks for whatever help!!
-
WSharrella
AskWoody LoungerWow. Now the fun begins …….
This may take me some time to work through, but thanks for the headstart. I’ll report back if there is success or if I have to give up …..
Thanks again! Andrew
-
WSharrella
AskWoody LoungerMay 21, 2002 at 12:39 pm in reply to: VB/VBA code to change HP Printer settings? (Word 2000) #589259Thanks Rory — but if it gets too hairy/scary, don’t worry — remember you’re talking to a newbie that has to get this all to work!!! If it get’s too complex, it may get beyond my ability to implement!!
-
WSharrella
AskWoody LoungerMay 21, 2002 at 11:49 am in reply to: VB/VBA code to change HP Printer settings? (Word 2000) #589245Thanks for the leads on the escape codes. The more I think about it, the more I’m not sure the codes will work. The problem lies in the fact that despite my telling the printer how I want to print my document (e.g. macro code says print from tray 1 with letter-size paper) if the printer thinks it has legal-sized paper in tray 1, then it will skip printing from tray 1 and use another tray.
Maybe what I’m looking for is a PCL-type command to send to the printer via my macro to change the paper-type designation of tray 1. I’m going to spend some more time at the HP site looking into the PCL issue …
thanks, Andrew
-
WSharrella
AskWoody LoungerI know there were some problems with the HP4050 … interestingly, I heard of a fix that involves getting the firmware on the HP printer updated. It addresses just what you were saying was happening. Supposed to be free if printer is still under warranty.
Does anyone remember the “olden days” when you used to have to send escape codes to HP printers to get them to format correctly? I’m wondering if there is a way through a macro to send the escape codes and tell the printer that “paper type=draft and size=letter” so that the printer would reset itself ….
A thought …. anyone else have an idea?
thanks again …. Andrew
-
WSharrella
AskWoody LoungerOK, I’ve got the code … many thanks for what would have been the hard part for me to figure out — the registry lookup , etc …
A little info on the completed macro — I am not an HP printer expert. A big part of getting this macro to work was to check every printer(actually the driver) and then see what settings are made when different printers are used as the default printer.
Well …. Enjoy, and let me know what you think about my first effort here …….
‘*** Document Paper Type Macro ****************************
‘
‘Written by: Andrew Harrell on: 8/06/01
‘
‘**********************************************************Option Explicit ‘turn on required var declaration
‘Give the paper types a name; easier to follow code
Private Enum gtPaperType
draft = 1
Letterhead = 2
Other = 3
End Enum‘These next three subs form the macs for the toolbar
Public Sub SelDraftPaper()
Call DiscoverPrinter(draft)
End Sub
Public Sub SelLHPaper()
Call DiscoverPrinter(Letterhead)
End Sub
Public Sub SelOtherPaper()
Call DiscoverPrinter(Other)
End Sub‘ **********************************************************
‘ Discover Default Printer (by printer driver)
‘ **********************************************************
Private Sub DiscoverPrinter(ByVal intChoice As gtPaperType)
Dim strPrinter As String, strdriver As String, strServer() As String‘ *** Retrieve full printer name and port string
strPrinter = Application.ActivePrinter
‘ *** Strip port information
strPrinter = Left(strPrinter, InStr(1, strPrinter, ” on “, vbBinaryCompare) – 1)
‘ *** Parse server name from share name
strServer = Split(strPrinter, “”, , vbTextCompare)
‘ *** Look up driver name in Registry
strdriver = System.PrivateProfileString(“”, “HKEY_LOCAL_MACHINESoftware” & _
“MicrosoftWindows NTCurrentVersionPrintProvidersLanMan Print Services” & _
“Servers” & strServer(2) & “Printers” & strServer(3), “Printer Driver”)‘ *** Now call the proper Printer subroutine to set the bins
Select Case strdriver
Case Is = “HP LaserJet 5”
Call HP5BINZ(intChoice)
Case Is = “HP LaserJet 5N”
Call HP5BINZ(intChoice)
Case Is = “HP LaserJet 4 Plus”
Call HP5BINZ(intChoice)
Case Is = “HP LaserJet 4000 Series PCL”
Call HP4000BINZ(intChoice)
Case Is = “HP LaserJet 4050 Series PCL”
Call HP4000BINZ(intChoice)
Case Else
MsgBox Prompt:=”You must manually set Paper trays” & vbLf & “for this Printer: ” & strdriver, _
Buttons:=vbOKOnly + vbInformation, Title:=”Set Paper Trays”
End SelectEnd Sub
‘ **********************************************************
‘ End of Macro
‘ **********************************************************Private Sub HP5BINZ(ByVal intChoice As gtPaperType)
‘
‘ HP5BINZ Macro
‘ Macro recorded 8/01/2001 by Harrella
‘
With ActiveDocument.PageSetupSelect Case intChoice
Case Is = gtPaperType.draft
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
Case Is = gtPaperType.Letterhead
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterUpperBin
Case Is = gtPaperType.Other
.FirstPageTray = wdPrinterManualFeed
.OtherPagesTray = wdPrinterManualFeed
End SelectEnd With
End SubPrivate Sub HP4000BINZ(ByVal intChoice As gtPaperType)
‘
‘ HP4000BINZ Macro
‘ Macro recorded 8/01/2001 by Harrella
‘
With ActiveDocument.PageSetupSelect Case intChoice
Case Is = gtPaperType.draft
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
Case Is = gtPaperType.Letterhead
.FirstPageTray = 260
.OtherPagesTray = 261
Case Is = gtPaperType.Other
.FirstPageTray = 257
.OtherPagesTray = 257
End SelectEnd With
End Sub -
WSharrella
AskWoody LoungerHey, thanks for the effort and the code! It did work — I found the same registry data earlier in the evening, and fumbled thru getting the strDriver parsed to get to the share name (not as elegant as you did it). And it did work!!
Next step is to put in the conditionals for the printer driver types … will post the code as soon as Karen and I have tested …. thanks again!
-
WSharrella
AskWoody LoungerWill be happy to do so … will need to get with some of my more-experienced colleagues to apply … but will post back.
Many Thanks!!
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

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
-
Remove a User from Login screen
by
CWBillow
15 minutes ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
1 hour, 24 minutes ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
7 hours, 29 minutes ago -
Best and easiest way to Split PST File (Awaiting moderation)
by
Jamesjackson0847
3 hours, 51 minutes ago -
Is it a bug or is it expected?
by
Susan Bradley
6 hours, 24 minutes ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
4 hours, 2 minutes ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
12 hours, 2 minutes ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
1 hour, 38 minutes ago -
Multiple Partitions?
by
CWBillow
2 hours, 18 minutes ago -
World Passkey Day 2025
by
Alex5723
19 hours, 38 minutes ago -
Add serial device in Windows 11
by
Theodore Dawson
1 day, 10 hours ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
7 hours, 31 minutes ago -
Cached credentials is not a new bug
by
Susan Bradley
1 day, 15 hours ago -
Win11 24H4 Slow!
by
Bob Bible
1 day, 15 hours ago -
Microsoft hiking XBox prices starting today due to Trump’s tariffs
by
Alex5723
1 day, 12 hours ago -
Asus adds “movement sensor” to their Graphics cards
by
n0ads
1 day, 17 hours ago -
‘Minority Report’ coming to NYC
by
Alex5723
1 day, 14 hours ago -
Apple notifies new victims of spyware attacks across the world
by
Alex5723
2 days, 2 hours ago -
Tracking content block list GONE in Firefox 138
by
Bob99
2 days, 1 hour ago -
How do I migrate Password Managers
by
Rush2112
1 day, 9 hours ago -
Orb : how fast is my Internet connection
by
Alex5723
1 day, 11 hours ago -
Solid color background slows Windows 7 login
by
Alex5723
2 days, 14 hours ago -
Windows 11, version 24H2 might not download via Windows Server Updates Services
by
Alex5723
2 days, 12 hours ago -
Security fixes for Firefox
by
Susan Bradley
1 day, 13 hours ago -
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
3 days ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
3 days, 9 hours ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
3 days ago -
Return of the brain dead FF sidebar
by
EricB
2 days, 12 hours ago -
Windows Settings Managed by your Organization
by
WSDavidO61
1 day, 15 hours ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
17 hours, 9 minutes 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.