Results 1 to 29 of 29

Thread: outlook dll- get current outlook folder

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Red face outlook dll- get current outlook folder

    Hi,

    I've got this vb6 code that compiles into a dll. the code creates an outlook toolbar.

    I'd like to get the current outlook folder name (so to use it as a paramater)

    do you know the syntax for that?

    thanks,

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: outlook dll- get current outlook folder

    Does this help?

    you might have to tweak it a little...

    http://www.freevbcode.com/ShowCode.Asp?ID=1064
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    That just gets all the folders, not the selected one.

    What version of Outlook? In 2003 there is a .CurrentFolder property.


    vb Code:
    1. 'Assumes oApp (Outlook.Application) object is already created
    2. Dim oExp As Outlook.Explorer
    3. Dim oBox As Outlook.MAPIFolder
    4. Set oExp = oApp.ActiveExplorer
    5. Set oBox = oExp.CurrentFolder
    6. MsgBox oBox.Name
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    oApp - variable not defined

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    Read the code comment
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    I've tried to add dim oApp as Outlook.Application, but my application stopped working after that.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    here's the context

    Public Function SaveMailAsMSG(ByRef Item As Outlook.MailItem, _
    ByVal ItemNo As Long, _
    ByVal FilingNo As Long, ByVal FilingArea As Long) As Boolean
    Dim fname As String
    Dim reqdir As String
    Dim filingnotes As String
    Dim lBackslashPos, sPartialPath

    ' Dim oExp As Outlook.Explorer
    ' Dim molTrustedApp As Outlook.Application
    ' Set oExp = molTrustedApp.ActiveExplorer

    On Error GoTo error_filing

    'create the item file name.
    fname = Right(ReplaceIllegalChars(Item.Subject), 50)
    ' MsgBox oExp.CurrentFolder
    ' fname = fname & "_" & Right(ReplaceIllegalChars(oExp.CurrentFolder), 50)

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    Look at the code. See oApp is defined as an Outlook.Application? Now you have molTrustedApp which appears to be an Outlook.Application too. Just switch them out and use only molTrustedApp.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    I did the molTrustedApp definition (instead of oaPP, and have not used oApp anywhere)

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    Is molTrustedApp already created and Outlook displayed?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    I'll try to explain the bigger picture. I got a vb6 code that is compiled as a dll and is used in outlook2003 to create a toolbar. the toolbar has buttons to save the current message in outlook as an msg file to a specific folder.

    I'd like the name of the msg file to contain the outlook folder that it is stored in.

    please let me know if this explains it better, or if you would like to know further details,

    thanks,

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    Well thats not what you had asked. Only asked for getting a currently selected folder.

    Ok, now with that scenerio

    Just attach an object variable to the current selected object. You may want to verify that its a MailItem object too.

    Dim oMsg As Outlook.MailItem
    Set oMsg = oExp.Selection
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    I only tried to explain the big picture- I've got all the code working (it stores the message) except for to make the folder name a part of the msg filename.

    I don't know why what you sent is not working...

    thanks,

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    and also, maybe you can answer my other thread for the same code: how to open up an explorer window from this dlll (as a button on the toolbar).

    thanks,

  15. #15
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    Well I dont have all your project so I cant say why its not working but the code does do what you asked. Just need to implement it into your code correctly.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    here it is:

    Public Function SaveMailAsMSG(ByRef Item As Outlook.MailItem, _
    ByVal ItemNo As Long, _
    ByVal FilingNo As Long, ByVal FilingArea As Long) As Boolean
    Dim fname As String
    Dim reqdir As String
    Dim filingnotes As String
    Dim lBackslashPos, sPartialPath

    ' Dim oExp As Outlook.Explorer
    ' Dim molTrustedApp As Outlook.Application
    ' Set oExp = molTrustedApp.ActiveExplorer


    'create the item file name.
    fname = Right(ReplaceIllegalChars(Item.Subject), 50)
    ' MsgBox oExp.CurrentFolder
    ' fname = fname & "_" & Right(ReplaceIllegalChars(oExp.CurrentFolder), 50)
    fname = "Mail" & "_" & _
    Day(Date) & "_" & Month(Date) & "_" & Year(Date) & "_" & _
    fname & _
    "-" & Hour(Now) & Minute(Now) & Second(Now)

    reqdir = FILING_DIR & "\" & FilingArea & "\" & ItemNo
    reqdir = reqdir & "\" & FilingNo
    filingnotes = reqdir & "\" & fname
    filingnotes = filingnotes & ".msg"

    'save filing item
    Item.SaveAs filingnotes, olMSG

    end function

  17. #17
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    I still dont see where you have your application object variable?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    do you mean the definitions in the start of the module ?

    Option Explicit

    DefStr S: DefBool B: DefLng L: DefCur C: DefDate D
    DefByte Y: DefInt I: DefSng N: DefDbl U

    Private cn As ADODB.Connection
    Private cmFilings As ADODB.Command

    Private colStationIds As Collection
    Private colFilingAreaIds As Collection
    Private colFilingIds As Collection

    Private bmIsConnected

  19. #19
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    Where is it being created and what is the definition of "molTrustedApp"?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  20. #20

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    please look at the function (2 messages ago)

    Dim molTrustedApp As Outlook.Application

    thanks,

  21. #21
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    But it is commented out and not used. Is it originally somewhere else? You need to have the application object created somewhere?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  22. #22

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    yes, as I said when I didn't commented out the whole part of the folder name, this function didn't work at all (I got no error messages- even on error event didn't occur (it just didn't save the item as msg). when I tried to display its value using msgbox it didn't show any message box at all. that is why you see all of the related code commented out.

  23. #23
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    I'm sorry but you are just not getting it. In order for your app or addin or whatever it is to automate or integrate with outlook you need an application object. You cant export your msgs just with the code you posted.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  24. #24

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    I just noticed your reply...

    you are right- I don't get it!
    here's the function again, with the commented parts not commented. please try to explain / add the missing code to make it work.

    thanks,



    Public Function SaveMailAsMSG(ByRef Item As Outlook.MailItem, _
    ByVal ItemNo As Long, _
    ByVal FilingNo As Long, ByVal FilingArea As Long) As Boolean
    Dim fname As String
    Dim reqdir As String
    Dim filingnotes As String
    Dim lBackslashPos, sPartialPath

    Dim oExp As Outlook.Explorer
    Dim molTrustedApp As Outlook.Application
    Set oExp = molTrustedApp.ActiveExplorer


    'create the item file name.
    fname = Right(ReplaceIllegalChars(Item.Subject), 50)

    fname = fname & "_" & Right(ReplaceIllegalChars(oExp.CurrentFolder), 50)
    fname = "Mail" & "_" & _
    Day(Date) & "_" & Month(Date) & "_" & Year(Date) & "_" & _
    fname & _
    "-" & Hour(Now) & Minute(Now) & Second(Now)

    reqdir = FILING_DIR & "\" & FilingArea & "\" & ItemNo
    reqdir = reqdir & "\" & FilingNo
    filingnotes = reqdir & "\" & fname
    filingnotes = filingnotes & ".msg"

    'save filing item
    Item.SaveAs filingnotes, olMSG

    end function

  25. #25
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    If this is your addin then there has to be some other outlook code then the three lines of code I posted. Do you have some other outlook code?

    Dim oExp As Outlook.Explorer
    Dim molTrustedApp As Outlook.Application
    Set oExp = molTrustedApp.ActiveExplorer

    This alone will not do it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  26. #26

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    the code has several modules. the module of this function doesn't have any other outlook defintions. but another module that calls this function has several outlook global definitions in the start of the module :

    Private molTrustedApp As Outlook.Application

    Private WithEvents mcolInspectors As Outlook.Inspectors
    Private colInspectorToolbars As Collection

    Private WithEvents mcolExplorers As Outlook.Explorers
    Private colExplorerToolbars As Collection

    Private lInspectorULimit, lExplorerULimit

    Private WithEvents colSentItems As Outlook.Items


    and on another module:
    ------------------------

    Private Const EXPLORER_TAG_PREFIX As String = "EXPLORER"

    Private WithEvents mxplOpened As Outlook.Explorer
    Private mclsParentApp As CAccessOL

    Private mlUnderlying As Outlook.MailItem

    Private lmUniqueIndex

    Private barAccessOLToolbar As Office.CommandBar

    the other module that defines the toolbar:
    ------------------------------------------

    Private Const INSPECTOR_TAG_PREFIX As String = "INSPECTOR"

    Private WithEvents mispExisting As Outlook.Inspector
    Private mclsParentApp As CAccessOL

    Private lmUniqueIndex

    Private WithEvents mlUnderlying As Outlook.MailItem

    Private barAccessOLToolbar As Office.CommandBar

    Private cboFilings As Office.CommandBarComboBox
    Private cboStations As Office.CommandBarComboBox
    Private WithEvents cboFilingAreas As Office.CommandBarComboBox

    Private WithEvents btnSubmit As Office.CommandBarButton
    Private WithEvents btnSendNSubmit As Office.CommandBarButton
    Private btnStatus As Office.CommandBarButton

    Private WithEvents cboFilings As Office.CommandBarComboBox
    Private cboStations As Office.CommandBarComboBox
    Private WithEvents cboFilingAreas As Office.CommandBarComboBox

    Private WithEvents btnSubmit As Office.CommandBarButton
    Private WithEvents btnSendNSubmit As Office.CommandBarButton
    Private btnStatus As Office.CommandBarButton

  27. #27

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    can I ask you to respond to my very new threads about the same dll code on "office development" ?

    thanks,

  28. #28
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: outlook dll- get current outlook folder

    Ok, now we are getting somewhere. The one thing I see its that all the ourlook object variables are declared Private. Are they only used in the module and perhaps passed in functions?

    What Im trying to find is where and what your Outlook.Application object variable is called and if its not public then how are we able to access it.

    See the ...
    Private WithEvents mcolExplorers As Outlook.Explorers
    declaration in a module is what we can use to set the oExp object variable but how can you reference it if its Private to that one particular module?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  29. #29

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: outlook dll- get current outlook folder

    the function is called with the paramater of the current email item which is defined as mlUnderlying (Set mlUnderlying = ispExisting.CurrentItem , or Set mlUnderlying = mxplOpened.Selection.Item(1))

    did you mean to ask about that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width