Results 1 to 5 of 5

Thread: How to make outlook's Vb code as exe

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    2

    How to make outlook's Vb code as exe

    I need to set the 20(same) Categories in 100 users's Outlook. Users don't want to manually create. Solution would be, running the exe on their machines , this VB code should be executed and set the Categories.
    From Outlook Tools/Macro->Visual Basic Editor, if we paste the atached code(VB code) , then do F5, that will set the categories.


    This code is saved as VbaProject.OTM under
    C:\WINNT\Profiles\%USERPROFILE%\Application Data\Microsoft\Outlook

    If I copy this file to some other users's Outlook directory, still the user has to go to VB editor and execute. Users do not want go to this editor


    I am not sure, how to ake this code as exe, so it can run in users outlook.

    if you have any suggestions to make this code as exe that would be great.


    Thanks in advance,
    Attached Files Attached Files

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: How to make outlook's Vb code as exe

    Moved to the VB6 forum. The FAQ forum is for frequently asked questions.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to make outlook's Vb code as exe

    You would need to place the code in a new vb6 project and then compile it into an EXE

    Once that is done, you would need to create an installation and setup package which the users would need to run on their individual machines.

    This would install the exe...once installed, the users would then have to run it.

    It would seem to me to be less work to simply run it from the Outlook editor.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    2

    Re: How to make outlook's Vb code as exe

    Thanks a lot for the reply. I made exe. I can run the exe on users machine. It sets the categories. I have one more question. I am setting the categories using array.
    If objNameSpace.Categories.Count > 0 Then
    For lngPosition = LBound(objCategoryNew) To UBound(objCategoryNew)
    objNameSpace.Categories.Add (objCategoryNew(lngPosition))
    Next lngPosition
    End If

    If the categories are already exist, it gives error msg as 'Duplicate category name'


    The code first should check whether the category exist. If exist, it should not set it. can you please let me know which method I should use to check whether the element of the array alreay exist?

    Thanks in advance,
    Kavitha

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

    Re: How to make outlook's Vb code as exe

    It would be better to either use the Profile Wizard or to create a Outlook Add-In

    Instead of assuming it doesnt exist and adding all 100 you should check for an items existance first before adding 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

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