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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top