Search string for specific word

L

Lasse

Hi

Is there a VBA command to search a string for a specifik word?

I create a string with the printername and I need different things to happen
according to which default printer the user have selected.

/Lasse
 
M

macropod

Hi Lasse,

You could use the Instr function. For example, the following code tests returns 'True' if the active printer is the Adobe Acrobat
distiller:
Sub TestPrinter()
MsgBox InStr(Application.ActivePrinter, "Adobe") > 0
End Sub
 
Top