locked
Where is list of available 'Classes' or 'Types' of Objects you can Declare? Like RecordSet, NameSpace, MAPIFolder, Attachment, Shape, etc RRS feed

  • Question

  • We all know about declaring regular variables like...

    Dim X As String
    Dim Y As Integer
    Dim Z As Double

    But you can ALSO Declare Object Variables like...

    Dim rs As RecoredSet
    Dim ns As NameSPace
    Dim mf As MAPIFolder
    Dim att As Attachment
    Dim oShp As Shape

    Then you Assign an Object Reference to the Object Variable like...

    Set rs = CurrentDb.OpenRecordSet.("myTable")
    Set ns = GetNameSpace("MAPI")
    Set mf = ns.GetDefaultFolder(olFolderItem)
    Set oShp = ThisDocument.Pages(1).Shapes(3)

    So The Question Is:

    Where is the list of available "Classes' or 'Types' of Objects you can Declare?

    I've tried entering a test line of code in a module and observing the options Intellisense offers... like typing the Application name followed by a dot... like...
    Access.
    or
    Outlook.
    or whatever
    BUT neither shows me "Namespace" as an option in the intellisense drop down

    I see some of these in the Object Model for the Application... but not all... 

    For instance the NoteItem Object is not shown on the Outlook Object Model...

    I can drill down manually looking for it... by guessing where it should be or guessing at what the object 'may be'... like clicking on Items Collection or Items Object and looking in the "See Also" area...

    But this seems hit and miss to me... as you either have to know what you are looking for or just keep guessing and poking till you find something that looks like it may do it.

    So the Question is... IS THERE A COMPLETE LIST SOMEWHERE showing all the available Classes or Types of Objects you can Declare with a Dim statement?

    Thanks for any help on this.

     

    Wednesday, October 12, 2011 9:06 PM

Answers

All replies

  • You can try to search in the MSDN sites, below is the Outlook Object Model (2003) for example:

    http://msdn.microsoft.com/en-us/library/aa221870(v=office.11).aspx

     

    Another thread in here, what's new in 2007 (2 articles):

    http://msdn.microsoft.com/en-us/ms772422.aspx

    http://msdn.microsoft.com/en-us/bb226714

     

    Search for the Object Model, below the Access Object Model for 2007 for example:

    http://msdn.microsoft.com/en-us/library/bb266848(v=office.12).aspx

     

    Hope this helps,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    • Edited by danishani Wednesday, October 12, 2011 9:30 PM add link
    • Proposed as answer by danishani Monday, November 28, 2011 10:31 PM
    • Marked as answer by danishani Wednesday, January 11, 2012 8:35 PM
    Wednesday, October 12, 2011 9:27 PM
  • Thanks Daniel.

    I think clicking Vied > Object Browser from the VBE window gives the complete list for each active reference library.

    Right?

     

    • Proposed as answer by danishani Monday, November 28, 2011 10:31 PM
    • Marked as answer by danishani Wednesday, January 11, 2012 8:35 PM
    Wednesday, October 12, 2011 10:27 PM
  • Yes thats correct, you can filter the VBE window to select only one Library instead of All, so you have a better overview.

    See below screenshot, for the Outlook Object for example:

     

    The above links via MSDN, give you the same thing, but with more info regarding the relation and functionality in some cases.

     

    Hope this helps,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Wednesday, October 12, 2011 10:37 PM