Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   AdvancedSearch Method (http://www.outlookbanter.com/outlook-vba/34701-advancedsearch-method.html)

Irene December 6th 06 11:29 PM

AdvancedSearch Method
 
Am I able to use the AdvancedSearch Method from the Outlook object in MS
Word VBA?
Thanks,


Ken Slovak - [MVP - Outlook] December 7th 06 12:06 AM

AdvancedSearch Method
 
Sure. You might trip the security if you access any restricted properties or
methods, for example Send, since you're not running in-process with Outlook
as Outlook VBA. Any application that can use Outlook automation can code
with Outlook methods, properties and events.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Irene" wrote in message
...
Am I able to use the AdvancedSearch Method from the Outlook object in MS
Word VBA?
Thanks,



Irene December 7th 06 11:00 PM

AdvancedSearch Method
 
Thanks,

When i use the AdvancedSearch Method in Outlook at insert "Private Sub
Application_AdvancedSearchComplete(ByVal SearchObject As Search) " Function
in the ThisOutlookSession, where should i insert it if i use Word as my
application?

Irene

"Ken Slovak - [MVP - Outlook]" wrote:

Sure. You might trip the security if you access any restricted properties or
methods, for example Send, since you're not running in-process with Outlook
as Outlook VBA. Any application that can use Outlook automation can code
with Outlook methods, properties and events.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Irene" wrote in message
...
Am I able to use the AdvancedSearch Method from the Outlook object in MS
Word VBA?
Thanks,




Ken Slovak - [MVP - Outlook] December 8th 06 12:02 AM

AdvancedSearch Method
 
In your Word code put this at class module level:

Private WithEvents oOL As Outlook.Application

That will let you view the template for that event handler. Of course you
need a reference to Outlook in your Word project. Use WithEvents for any
object declaration when you want to handle events. It must be in a class or
form module and that class or form has to have scope throughout the life of
your application.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Irene" wrote in message
...
Thanks,

When i use the AdvancedSearch Method in Outlook at insert "Private Sub
Application_AdvancedSearchComplete(ByVal SearchObject As Search) "
Function
in the ThisOutlookSession, where should i insert it if i use Word as my
application?

Irene




All times are GMT +1. The time now is 08:37 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com