Consulting

Results 1 to 18 of 18

Thread: Solved: Distributing Outlook programs

  1. #1
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location

    Solved: Distributing Outlook programs

    Hi hi everyone, new to this forum as well as VBA for outlook.

    I have just written myself a program with redemption library and created an icon to activate a form inside Outlook .

    The problem now is i wish to create a standalone installer such that this installer can be posted online and ppl can just dl and install which will set up the whole add-on and register the toolbar icon onto their Outlook.
    I looked thru serveral ways, 1 of which is to create COM ADD IN? However i do not have VB6 or VC++ ..isit possible to create COM ADDIN using the VBAEditor in Outlook ? Another way is by using Visual Studio Installer?

    As i am totally new to VB prgraming i am not sure which way to use or even if those that i mentioned are pointing in the right direction. Hence would appreciate it if someone can point me in the correct way.
    Thanks alot

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi and welcome to VBAX

    At the moment you have raw code which is compiled as it is run in the VBE. Most likely, to distribute your code, you will need to create a COM addin which is done pre-compiling the code using a development enviroment like VB5/6, VC++/J++ or Mircosoft Office Developer. (VBEditor will not do this)

    Having done that, you would then use Visual Studio Installer (or a similar app) to create an install package (a setup exe or msi file) which is just a means of configuring where the files are copied and creating reistry entries etc

    I don't really think there are any shortcuts to doing this...
    K :-)

  3. #3
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location
    Thanks alot Killian
    I would try to compile the code on my friend's PC and carry on from there.
    At least i know i am on the right track.
    If there's anyother way to go around this pls do post it here too. Welcome all replies

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi and Welcome to VBAX!

    No there aren't any! The methods provided by Killian are the best of the buck.

    Outlook is poorly equipt for code distribution and a com-addin is what you should make. (Other than that you can import an OTM-file and other code moduls but this will get messy for sure)

    Good luck!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  5. #5
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location
    okie i got a copy of VB now, however my project is in Outlook which is a *.otm file.
    I want to import this project into VB6 and compile it and create com add in...however when i open this project it shows gibberish on my coding section.
    How do i convert the code from the OL otm into VB6 and den create a com addin?
    thanks for the time

  6. #6
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    Been a while for me that I've used VB 6.0. so cannot help you.

    Not used to giving links but this will get you started:
    I'm shure Killian will drop by to assist you.

    Enjoy!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  7. #7
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hello... did someone mention my name???

    Well it's not quite as straight-forward as you may have hoped.

    To be honest, you will need to read up on the process at MSDN (at the very least the pages that Joost posted, plus whereever the links take you) since then are quite a few details to cover and trying to do it by the numbers without having an understanding of what each step involves is likely to lead to frustration.
    But don't be discouraged - it's not too bad!

    Here it is in principle: you start by creating a new ActiveX DLL from the File>new menu. Then you need to add the references required (Project>References) which will be Microsoft Add-in Designer, the Outlook and Office object models (plus any you added in your Outlook project).
    The next step is amending the code automatically provided to fit your AddIn (name, commandbars etc). You will also need to register it with windows and the target application, add your Outlook code (in a new module) and create the calls to your code from the command bar action and/or whatever application events you're using.

    I know it sounds like a lot and the MS descriptions aren't always as clear as they could be but the VB6 IDE is familiar enough for a VBA programmer and if you read up on the principles first it should all come together.

    It's been a while since I did this myself so I would recommend to search MSDN for as many related articles as you can specific to your Office version since Outlook code and COMs have been the subject of a lot of security updates that might catch you out.

    If you run into any real problems, please post back and we'll try to work it out. (I don't use Outlook at home and use .NET at work so there may be some head-sratching involved on this one)

    Good luck!
    K :-)

  8. #8
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location
    Really thanks alot for the help, at least i have been pointed in the right direction. Yeah i am getting somewhere near my simple tester dll. It's loading correctly and now i just need to convert my real project into VB. You guys are really helpful! Thanks. Will post back if i run into more problems!

  9. #9
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Killian
    Hello... did someone mention my name???
    Yeah it's me! What took you so long....

    @se4mo2,

    You're welcome and good luck with building your addin!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  10. #10
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location
    hi, ran into a prob here. Got this line in my OL program..but when i transfer it to VB6 it gave an error(User defined type not defined)

    Public Function GetTextFileStreamForReading(strFilePath As String) As Scripting.TextStream

    how do i get around it?

  11. #11
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    The compiler doesn't know what a Scripting.TextStream object is... You'll need to add a reference to the Microsoft Scripting Runtime library
    K :-)

  12. #12
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location
    Opps yeah, i sorta figured that out after i posted. Sorry still a newbie in VB, thanks for the fast reply.

  13. #13
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location
    really feeling sorry, got another COM addin problem now with my redemption dll..i got this sub that creates a redemption object..
    I called this sub when the Addin is OnConnection like
    Dim xxx as Redemp
    xxx.CreateARedemption


    <<<<Class Redemp coding>>>
    Private WithEvents m_redUtil As Redemption.MAPIUtils

    Public Sub CreateARedemption()
    Set objRe= CreateObject("Redemption.MAPIUtils")
    MsgBox ("Redl Created")
    End Sub

    Private Sub objRe_NewMail(ByVal Item As Object)
    Msgbox ("You got new Mail!")
    End Sub

    after calling this in a module..a redemption object should be created right? I override the new mail procedure with the above sub so that everytime i got a new mail, a msg would pop up. However i din't get any msg popping up when i have new mail., thou the object is created as i see the Object Created msg box.. Why is that so? I added references to all librarys. It could work inside my OutLook VBA

  14. #14
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    OK, well I don't know anything about the redemption object so it's time for a little guesswork...
    Firstly, if you don't use the Redemption addin, can you detect the Outlook native NewMail event? If not, your DLL isn't picking up the application events, just the ones you trigger with code.

    However, it seems to me there's no connection between the objRe object you create and the m_redUtil object with its events enabled

    If the redemption object is added as a reference, you don't need to explicitly create and instance of it but what you do need, is to create an instance of the class you have created (with events).

    So in a class named cRedemp:
    Private WithEvents m_redUtil As Redemption.MAPIUtils

    Private Sub m_redUtil_NewMail(ByVal Item As Object)
    Msgbox ("You got new Mail!")
    End Sub

    and then when you connect:
    Set objRe = New cRedemp

    Now I'm not sure whether you would then need to initialize objRe or anything in the cRedemp class or if the Repemdtion object takes care of this... hopefully you've got some kind of documentation.

    Hope that helps !?
    K :-)

  15. #15
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location
    my bad, dint managed to see that..oki ,changed the line
    Private WithEvents m_redUtil As Redemption.MAPIUtils
    to
    Private WithEvents objRe As Redemption.MAPIUtils
    and it still din't work.(kept my original codes)

  16. #16
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    did you create an instance of the class rather than the object?
    Set objRe = New cRedemp
    because it's the object within the class that has events enabled
    K :-)

  17. #17
    VBAX Regular
    Joined
    May 2005
    Posts
    12
    Location
    Okie the program's done. Thanks for all your help.

    Thread Closed

  18. #18
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Glad to see you've got it working!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

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