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

What is Attributes and WithEvents???



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 4th 09, 07:36 AM posted to microsoft.public.outlook.program_vba
masani paresh[_3_]
external usenet poster
 
Posts: 18
Default What is Attributes and WithEvents???

Hi All,

Could anyone please help me to understand below code. It shows me systax
error when I copy paste in ThisOutlookSession in my outlook.

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
End
VB_Name = "ThisOutlookSession"
VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Public WithEvents colExplorers As Outlook.Explorers
Attribute colExplorers.VB_VarHelpID = -1
Public WithEvents objExplorer As Outlook.Explorer
Attribute objExplorer.VB_VarHelpID = -1
--
Thanks,
Paresh
  #2  
Old March 4th 09, 02:37 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default What is Attributes and WithEvents???

Well, for one thing BEGIN...END blocks aren't VBA code, so I'd expect
errors. That looks like some Pascal or Delphi type code. VERSION also isn't
VBA code.

None of the variables is declared as to type, which will make them all
Variants if Option Explicit is off, with that option on there are more
errors.

Attribute is also not VBA code, unless it's qualified as to what it refers
to.

WithEvents is VBA/VB for declaring an object that handles events and makes
those events accessible to you code.

That looks like some weird mix of VBA and Delphi or Pascal code to me. I'd
expect lots of errors.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
news
Hi All,

Could anyone please help me to understand below code. It shows me systax
error when I copy paste in ThisOutlookSession in my outlook.

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
End
VB_Name = "ThisOutlookSession"
VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Public WithEvents colExplorers As Outlook.Explorers
Attribute colExplorers.VB_VarHelpID = -1
Public WithEvents objExplorer As Outlook.Explorer
Attribute objExplorer.VB_VarHelpID = -1
--
Thanks,
Paresh


  #3  
Old March 5th 09, 01:44 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook][_2_]
external usenet poster
 
Posts: 26
Default What is Attributes and WithEvents???

Actually, it looks like what you get if you export the ThisOutlookSession
module from VBA to a .cls file and then open that .cls file in Notepad. It
should be possible to import the file into VBA and then see the imported code
in the new class module that the import creates.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54




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

Well, for one thing BEGIN...END blocks aren't VBA code, so I'd expect
errors. That looks like some Pascal or Delphi type code. VERSION also isn't
VBA code.

None of the variables is declared as to type, which will make them all
Variants if Option Explicit is off, with that option on there are more
errors.

Attribute is also not VBA code, unless it's qualified as to what it refers
to.

WithEvents is VBA/VB for declaring an object that handles events and makes
those events accessible to you code.

That looks like some weird mix of VBA and Delphi or Pascal code to me. I'd
expect lots of errors.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
news
Hi All,

Could anyone please help me to understand below code. It shows me systax
error when I copy paste in ThisOutlookSession in my outlook.

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
End
VB_Name = "ThisOutlookSession"
VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Public WithEvents colExplorers As Outlook.Explorers
Attribute colExplorers.VB_VarHelpID = -1
Public WithEvents objExplorer As Outlook.Explorer
Attribute objExplorer.VB_VarHelpID = -1
--
Thanks,
Paresh



  #4  
Old March 5th 09, 01:06 PM posted to microsoft.public.outlook.program_vba
masani paresh[_3_]
external usenet poster
 
Posts: 18
Default What is Attributes and WithEvents???

Perferctly correct Sue. You are really great. I have purchased your two books
on Configuration Outlook 2003 and Microsof Outlook 2007 programming. Its
awesome.

We have been facing so many problems in free/busy information while booking
conference through outlook. Actually problem is free/busy status is not
getting updated immediately once user booked the conference room and mean
while some other user select the same conference as he can see the free
status.

If you have any ideas on this issue or your any of book talk about this then
please let me know. Actually I purchase Configuring Microsoft Outlook for
this issue but it didn't help much.

--
Thanks,
Paresh


"Sue Mosher [MVP-Outlook]" wrote:

Actually, it looks like what you get if you export the ThisOutlookSession
module from VBA to a .cls file and then open that .cls file in Notepad. It
should be possible to import the file into VBA and then see the imported code
in the new class module that the import creates.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54




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

Well, for one thing BEGIN...END blocks aren't VBA code, so I'd expect
errors. That looks like some Pascal or Delphi type code. VERSION also isn't
VBA code.

None of the variables is declared as to type, which will make them all
Variants if Option Explicit is off, with that option on there are more
errors.

Attribute is also not VBA code, unless it's qualified as to what it refers
to.

WithEvents is VBA/VB for declaring an object that handles events and makes
those events accessible to you code.

That looks like some weird mix of VBA and Delphi or Pascal code to me. I'd
expect lots of errors.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
news
Hi All,

Could anyone please help me to understand below code. It shows me systax
error when I copy paste in ThisOutlookSession in my outlook.

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
End
VB_Name = "ThisOutlookSession"
VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Public WithEvents colExplorers As Outlook.Explorers
Attribute colExplorers.VB_VarHelpID = -1
Public WithEvents objExplorer As Outlook.Explorer
Attribute objExplorer.VB_VarHelpID = -1
--
Thanks,
Paresh



  #5  
Old March 5th 09, 01:07 PM posted to microsoft.public.outlook.program_vba
masani paresh[_3_]
external usenet poster
 
Posts: 18
Default What is Attributes and WithEvents???

Thanks Ken for you reply.
--
Thanks,
Paresh


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

Well, for one thing BEGIN...END blocks aren't VBA code, so I'd expect
errors. That looks like some Pascal or Delphi type code. VERSION also isn't
VBA code.

None of the variables is declared as to type, which will make them all
Variants if Option Explicit is off, with that option on there are more
errors.

Attribute is also not VBA code, unless it's qualified as to what it refers
to.

WithEvents is VBA/VB for declaring an object that handles events and makes
those events accessible to you code.

That looks like some weird mix of VBA and Delphi or Pascal code to me. I'd
expect lots of errors.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
news
Hi All,

Could anyone please help me to understand below code. It shows me systax
error when I copy paste in ThisOutlookSession in my outlook.

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
End
VB_Name = "ThisOutlookSession"
VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Public WithEvents colExplorers As Outlook.Explorers
Attribute colExplorers.VB_VarHelpID = -1
Public WithEvents objExplorer As Outlook.Explorer
Attribute objExplorer.VB_VarHelpID = -1
--
Thanks,
Paresh



 




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
ScanPst have run time attributes? Al Franz Outlook - General Queries 1 February 19th 09 10:42 PM
How to create a Mirror image Calender with certain attributes of o a Outlook - Calandaring 1 April 6th 07 12:58 AM
Outlook 2007 Scheduled item attributes displayed in calendar Steve300 Outlook - Calandaring 0 March 21st 07 05:34 PM
WithEvents-Problem in compiled Com-Add-In Peter Marchert Outlook and VBA 5 November 20th 06 09:41 PM
Outlook 2003. use of Withevents gives error 430 Jan Lefere Outlook and VBA 1 May 16th 06 01:08 PM


All times are GMT +1. The time now is 05:12 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-2025 Outlook Banter.
The comments are property of their posters.