dcsimg
Results 1 to 6 of 6

Thread: [RESOLVED] Outlook 2007 macro (.otm project) to add-in - VB6?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    15

    Resolved [RESOLVED] Outlook 2007 macro (.otm project) to add-in - VB6?

    Is it possible to create an add-in for Outlook 2007 using VB6.0 architechture? Don't have visual studio but I have a macro that I need to distribute to some users. I am unable to find a tutorial to get me started. Any guidance?

    Thanks!
    Coot

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,698

    Re: Outlook 2007 macro (.otm project) to add-in - VB6?

    Welcome to the Forums.

    Yes you can use VB6 to write an AddIn for Outlook or any other Office app but this is what you need for your situation.

    Outlook Macro Deployment FAQ - http://www.vbforums.com/showthread.php?t=406621
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    15

    Re: Outlook 2007 macro (.otm project) to add-in - VB6?

    Thanks Yoda. Perhaps I'm missing the point. I asked if I can write an Add-In in Outlook 2007 using VB6 and your short answer was yes but then you recommended I copy the project file to the other users profile directory, correct? I'm familiar with that method but I'm really hoping to make this an add-in.

    I've created a new add in project with a frmAddIn and a Connect. Then I imported all of my classes, modules and forms from the macro but I don't know how to connect the two! When i hit run, nothing happens. I'm not sure where to call my entry point from in the add-in template!

    I'm pasting the entry point to my Macro and want to call this sub in the Module1 of my macro from an Add-in.


    Code:
    Option Explicit
    Public IMS As Object         ' Late Binding
    Public PGMOPT   As clsPgmOpts
    Public UC As clsUserCodes
    Public myOrt As String
    Public hldIndex1 As Integer
    Public hldIndex2 As Integer
    
    Dim successCntr As Integer
    Dim savePath As String
    Dim fnCount As Integer
    Dim fnKeyIndex As Integer
    Dim flSuccess  As Long
    Dim fbInitSetup As Boolean
    Dim InitLoad       As Boolean
    Dim Success       As Boolean
    Dim attachmentCount As Integer
    Dim ctrlBox() As Control
    
    'Declaration
    Public myItems, myItem, myAttachments, myAttachment As Object
    'Dim myOrt As String
    Dim myOlApp As New Outlook.Application
    Dim myOlExp As Outlook.Explorer
    Dim myOlSel As Outlook.Selection
    
    
    
    Sub SendAttachmentToImage()
        FrmImport.Show (vbModeless)
        
        'Get destination and image parameters from form.
        myOrt = "c:\\Program Files\IMS21\IMPORT\"
        
    
        'work on selected items
        Set myOlExp = myOlApp.ActiveExplorer
        Set myOlSel = myOlExp.Selection
        
        Call ListAttachments
    
    End Sub

  4. #4
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,698

    Re: Outlook 2007 macro (.otm project) to add-in - VB6?

    Oh I read your post as you didnt have VB6 available to you. In that case, here is my FAQ on creating an AddIn using VB6 - http://www.vbforums.com/showthread.php?t=406641
    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    15

    Re: Outlook 2007 macro (.otm project) to add-in - VB6?

    Thanks Jedi Knight!

    Greatful I am because wisdom you share!

    Your FAQ page got me pointed in the right direction. There are many like it but this was easy to follow!

  6. #6
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,698

    Re: [RESOLVED] Outlook 2007 macro (.otm project) to add-in - VB6?

    Thanks, its always great to hear that it helped
    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

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width