• Conditional VBA References

    Author
    Topic
    #469362

    I have an application that uses a reference to the Outlook Object Library.

    and code that uses this reference eg –
    Dim appOutlook As Outlook.Application
    Dim oNamespace As Outlook.NameSpace

    Problem is that some users may not have Outlook installed.

    Others may have a different version of Office.

    Can anyone offer a strategy for dealing with this?

    Viewing 1 reply thread
    Author
    Replies
    • #1226987

      You could look at using Late Binding but people who don’t have Outlook still won’t be able to perform the actions that need outlook.

    • #1227092

      Yep, Late binding is the answer, of course this means declaring all the outlook objects as ‘Object’ and losing intellisense.

      But wiriting the code with the reference in place, and using early biinding, then converting it is fine.

      In this case the users without Outlook wont be able to get at the form doing the mail stuff, but now the code compiles on all machines regardless of whether they have Outlook.

      Thanks John.

    Viewing 1 reply thread
    Reply To: Conditional VBA References

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: