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

Getting started with VBA



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 9th 07, 08:42 PM posted to microsoft.public.outlook.general,microsoft.public.outlook.program_vba
Brian Tillman
external usenet poster
 
Posts: 17,452
Default Getting started with VBA

RON wrote:

I wrote a little routine:

Private Sub Test()
Dim ThisEmail As Object
Dim ol As Object
Set ol = CreateObject("Outlook.Application")
Set ThisEmail = ol.ActiveInspector.CurrentItem 'Errror 91 here
end sub

which I run from ThisOutlookSession (Outlook 2003).

But even this, emits a Error 91 Object variable not set error.

Outlook is open to the inbox.


This is not the programnming group. You want
news://msnews.microsoft.com/microsof...ok.program_vba . I have
set the follow up to that group.
--
Brian Tillman

Ads
  #2  
Old January 10th 07, 05:29 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Getting started with VBA


Please don't call CreateObject from within Outlook VBA. There's one
Application object already created that you should use.

ActiveInspector is valid if there's at least one Inspector opened, whereas
the object that shows folders (the Inbox e.g.) is called Explorer. So what
you probably want to access is the ActiveExplorer property.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)


Am Tue, 9 Jan 2007 15:42:42 -0500 schrieb Brian Tillman:

RON wrote:

I wrote a little routine:

Private Sub Test()
Dim ThisEmail As Object
Dim ol As Object
Set ol = CreateObject("Outlook.Application")
Set ThisEmail = ol.ActiveInspector.CurrentItem 'Errror 91 here
end sub

which I run from ThisOutlookSession (Outlook 2003).

But even this, emits a Error 91 Object variable not set error.

Outlook is open to the inbox.


This is not the programnming group. You want
news://msnews.microsoft.com/microsof...ok.program_vba . I have
set the follow up to that group.

 




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
Getting started laura Outlook - General Queries 5 August 26th 06 05:43 AM
OE could not be started ttago Outlook Express 11 May 6th 06 07:05 PM
how do i get started Alias Outlook Express 6 March 5th 06 08:45 AM
Help getting started!! hasnain mir mohammed Outlook Express 2 January 15th 06 10:21 AM
Getting Started Charlie Tame Outlook Express 0 January 7th 06 09:46 PM


All times are GMT +1. The time now is 06:23 AM.


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