A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Macro to search for word



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 25th 06, 04:13 PM posted to microsoft.public.outlook.program_vba
Dave Neve
external usenet poster
 
Posts: 8
Default Macro to search for word

Hello

I do not really know much about VBA and macros and Outlook does not even
have a macro recorder.

So I recorded the following macro in Word and inserted it into Outlook but
it doesn't work of course.

Could sm kindly indicate the problem or better still correct it?

The macro should search for the word "Sergic" in messages.

Thanks in advance

PS I'm pretty sure I can install it once it is written.


Ads
  #2  
Old July 25th 06, 04:20 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Macro to search for word

That's not possible, since you neither posted any code nor stated exactly what your goal is.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message ...
Hello

I do not really know much about VBA and macros and Outlook does not even
have a macro recorder.

So I recorded the following macro in Word and inserted it into Outlook but
it doesn't work of course.

Could sm kindly indicate the problem or better still correct it?

The macro should search for the word "Sergic" in messages.

Thanks in advance

PS I'm pretty sure I can install it once it is written.


  #3  
Old July 25th 06, 06:22 PM posted to microsoft.public.outlook.program_vba
Dave Neve
external usenet poster
 
Posts: 8
Default Macro to search for word

Oops a daisy

Here is the code (that doesn't work) to find the word 'Sergic' in messages.

Sorry about that.

Can anyone now help correct it please?

Thanks

Sub SearchSergic()

' Macro enregistrée le 25/07/2006 par Dave Neve

Selection.Find.ClearFormatting
With Selection.Find
.Text = "Sergic"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub


"Sue Mosher [MVP-Outlook]" a écrit dans le message
de news: ...
That's not possible, since you neither posted any code nor stated exactly
what your goal is.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message
...
Hello

I do not really know much about VBA and macros and Outlook does not even
have a macro recorder.

So I recorded the following macro in Word and inserted it into Outlook but
it doesn't work of course.

Could sm kindly indicate the problem or better still correct it?

The macro should search for the word "Sergic" in messages.

Thanks in advance

PS I'm pretty sure I can install it once it is written.




  #4  
Old July 25th 06, 07:18 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Macro to search for word

"find ... in messages" or "find in the currently open message" There's a world of difference. Please provide a complete description of what you're really trying to accomplish, in what version of Outlook, and with Word or Outlook as your default email editor.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message ...
Oops a daisy

Here is the code (that doesn't work) to find the word 'Sergic' in messages.

Sorry about that.

Can anyone now help correct it please?

Thanks

Sub SearchSergic()

' Macro enregistrée le 25/07/2006 par Dave Neve

Selection.Find.ClearFormatting
With Selection.Find
.Text = "Sergic"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub


"Sue Mosher [MVP-Outlook]" a écrit dans le message
de news: ...
That's not possible, since you neither posted any code nor stated exactly
what your goal is.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message
...
Hello

I do not really know much about VBA and macros and Outlook does not even
have a macro recorder.

So I recorded the following macro in Word and inserted it into Outlook but
it doesn't work of course.

Could sm kindly indicate the problem or better still correct it?

The macro should search for the word "Sergic" in messages.

Thanks in advance

PS I'm pretty sure I can install it once it is written.




  #5  
Old July 25th 06, 08:28 PM posted to microsoft.public.outlook.program_vba
Dave Neve
external usenet poster
 
Posts: 8
Default Macro to search for word

Hi

Well, normally it is "find in the currently open message" (as I use Copernic
desktop search for major searches thru multiple messages/folders

I have Office 2003 and I use Outlook as my default mail editor so the macro
has to work in Outlook.

I simply want to find the word 'Sergic' in certain messages that I open.

Hope this is all you need this time.

Thanks

Dave Neve

"Sue Mosher [MVP-Outlook]" a écrit dans le message
de news: ...
"find ... in messages" or "find in the currently open message" There's a
world of difference. Please provide a complete description of what you're
really trying to accomplish, in what version of Outlook, and with Word or
Outlook as your default email editor.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message
...
Oops a daisy

Here is the code (that doesn't work) to find the word 'Sergic' in
messages.

Sorry about that.

Can anyone now help correct it please?

Thanks

Sub SearchSergic()

' Macro enregistrée le 25/07/2006 par Dave Neve

Selection.Find.ClearFormatting
With Selection.Find
.Text = "Sergic"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub


"Sue Mosher [MVP-Outlook]" a écrit dans le
message
de news: ...
That's not possible, since you neither posted any code nor stated exactly
what your goal is.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message
...
Hello

I do not really know much about VBA and macros and Outlook does not even
have a macro recorder.

So I recorded the following macro in Word and inserted it into Outlook
but
it doesn't work of course.

Could sm kindly indicate the problem or better still correct it?

The macro should search for the word "Sergic" in messages.

Thanks in advance

PS I'm pretty sure I can install it once it is written.







  #6  
Old July 26th 06, 02:31 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Macro to search for word

So, what functionality are you looking for that the Edit | Find command doesn't give you?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message ...
Hi

Well, normally it is "find in the currently open message" (as I use Copernic
desktop search for major searches thru multiple messages/folders

I have Office 2003 and I use Outlook as my default mail editor so the macro
has to work in Outlook.

I simply want to find the word 'Sergic' in certain messages that I open.


  #7  
Old July 26th 06, 08:09 AM posted to microsoft.public.outlook.program_vba
Dave Neve
external usenet poster
 
Posts: 8
Default Macro to search for word

None.

I simply want to execute the macro with a single click and without needing
to type in the search word every time.

Regards

Dave Neve
"Sue Mosher [MVP-Outlook]" a écrit dans le message
de news: ...
So, what functionality are you looking for that the Edit | Find command
doesn't give you?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message
...
Hi

Well, normally it is "find in the currently open message" (as I use
Copernic
desktop search for major searches thru multiple messages/folders

I have Office 2003 and I use Outlook as my default mail editor so the
macro
has to work in Outlook.

I simply want to find the word 'Sergic' in certain messages that I open.



  #8  
Old July 26th 06, 10:52 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Macro to search for word

There's nothing simple about that at all. In fact, it can't be done in VBA without either a SendKeys kludge or a third-party programming library, Redemption (http://www.dimastr.com/redemption/), which exposes the necessary methods and properties in its SafeInspector object. Even with Redemption, I think you'll need to write code for three different editors, for the three different mail formats.

Maybe a quick-and-dirty alternative in your case is to use a combination of CommandBars techniques (see http://www.outlookcode.com/d/tips/commandbarfun.htm) and SendKeys to automate the Find command directly.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dave Neve" wrote in message ...
None.

I simply want to execute the macro with a single click and without needing
to type in the search word every time.

Regards

Dave Neve
"Sue Mosher [MVP-Outlook]" a écrit dans le message
de news: ...
So, what functionality are you looking for that the Edit | Find command
doesn't give you?



"Dave Neve" wrote in message
...
Hi

Well, normally it is "find in the currently open message" (as I use
Copernic
desktop search for major searches thru multiple messages/folders

I have Office 2003 and I use Outlook as my default mail editor so the
macro
has to work in Outlook.

I simply want to find the word 'Sergic' in certain messages that I open.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I search for a word within contact file? Julie K. Outlook - Using Contacts 6 December 15th 07 01:46 AM
Macro PE Outlook - General Queries 2 June 25th 06 10:34 PM
Index Search Refuses to search after MANY days of indexing--pls he JAYBO Outlook - Installation 5 June 15th 06 08:55 AM
Rules an macro Gerd Neumann Outlook and VBA 4 May 17th 06 10:48 PM
What does outlook search when you search Contacts ? [email protected] Outlook - General Queries 0 May 1st 06 08:51 PM


All times are GMT +1. The time now is 09:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.