Object required

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello. I am comparing the beginning of a string to another string using the
StartsWith() function. My line of code is:

if checkPrinter.StartsWith("\\medea\") then
WshNetwork.RemovePrinterConnection oPrinters.Item(i+1), true, false
end if

When the program gets to the line with the StartsWith(), I get an error
stating:

Object Required: 'Microsoft Office Doc'

Anybody know what this means? I am using Visual Studio .net 2003 to do a
..vbs. Thanks for any help!!

Brian
 
Use this instead.

if InStr(1, checkPrinter, "\\medea\") then
WshNetwork.RemovePrinterConnection oPrinters.Item(i+1), true, false
end if
 
It worked great! Thanks alot!!!!


Charlie Brown said:
Use this instead.

if InStr(1, checkPrinter, "\\medea\") then
WshNetwork.RemovePrinterConnection oPrinters.Item(i+1), true, false
end if
 
Back
Top