Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 14 Aug 2008 23:23:01 -0700,    group: microsoft.public.word.vba.general        back       


Search string for specific word   
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
date: Thu, 14 Aug 2008 23:23:01 -0700   author:   Lasse

Re: Search string for specific word   
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

-- 
Cheers
macropod
[MVP - Microsoft Word]


"Lasse"  wrote in message news:FDAAE9A7-C766-4DA0-9B42-8E5455FCCE09@microsoft.com...
> 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
date: Fri, 15 Aug 2008 16:50:36 +1000   author:   macropod lid

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us