none
windows.count=0 RRS feed

  • Question

  • Hi

    The following (Outlook VBA) code does nothing because windows.count = 0 (outlook win. , VBE win.,  & Browser are opened )

    Any help is appreciated

    For i = 1 To Windows.Count
            Debug.Print Windows(i).Parent.Name 
    Next

    Thanks

    Sunday, July 21, 2013 11:19 AM

Answers

  • I don't think you can do that programmatically, at least not using anything documented.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by BR-99 Tuesday, July 23, 2013 1:14 PM
    Monday, July 22, 2013 5:10 PM

All replies

  • Outlook does not have Application.Windows collection.

    What it does have is Application.Explorers and Application.Inspectors collections. You can also use Application.ActiveWindow/ActiveInspector/ActiveExplorer properties.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Sunday, July 21, 2013 4:37 PM
  • Thanks

    I try to access Outlook VBE toolbar - how should i do that ?

    Any sample VBA code ?

    thanks

    Sunday, July 21, 2013 5:34 PM
  • I don't think it can be accessed. Why do you need to do that?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Sunday, July 21, 2013 11:42 PM
  • Thanks.

    I want to auto. export all modules, forms & classes

    I  have VBE window handle &  toolbar

    Dim dock Dim cbar
    Dim Proj dock = FindWindowEx(l, 0, "MsoCommandBarDock", "MsoDockTop") strWindowTitle = Space(260) Call GetWindowText(dock, strWindowTitle, 260) Debug.Print strWindowTitle cbar = FindWindowEx(dock, 0, "MsoCommandBar", "Debug") strWindowTitle = Space(260) Call GetWindowText(cbar, strWindowTitle, 260) Debug.Print strWindowTitle

    Proj=FindWindowEx(l, 0, "PROJECT", "Project - Project1")

    MsoDockTop                                                                                                                                                                                                                                                          
    Debug

    I found that the project explorer class is "Project" hence i have its handle

    how do i access its items ? how do i retrieve win. body given its handle ?

    (SendDlgItemMessageW(Proj, &H47C, WM_GETTEXT, 260, VarPtr(Buffer(0))) retrieve nothing)

    regards






    • Edited by BR-99 Monday, July 22, 2013 12:24 PM
    Monday, July 22, 2013 6:44 AM
  • I don't think you can do that programmatically, at least not using anything documented.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by BR-99 Tuesday, July 23, 2013 1:14 PM
    Monday, July 22, 2013 5:10 PM