Results 1 to 9 of 9
  1. #1
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370

    Question Auto update reference

    Hello all,



    I've come to a problem where I need the reference "Microsoft Outlook xx.0 Object Library" checked.
    Unfortunately not everyone in my office who is using this database uses the same version of outlook. I'm looking for some code that scans the references and checks the correct "Microsoft Outlook Object Library" upon opening the database. I've found some code but I'm very inexperienced with code in general, so any modification would greatly help!

    Link to code that I found relating to this: http://www.excelthoughts.com/2005/06...nd-adding.html

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    I would probably use late binding, which doesn't require a reference:

    http://support.microsoft.com/KB/201096
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    I've looked into that, but more than half of the employees here will be using these specific lines of code that require the outlook library checked

  4. #4
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    From my understanding, it's only good to use late binding if the lines of code are not executed that often?

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    What lines "require" it to be checked? Constants can't be used, but they can be replaced by their numeric values. I wouldn't say it was only good to use late binding in that instance. It is true that early binding runs faster than late binding, but I doubt you'd notice the difference.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Dim olApp As Outlook.Application
    Dim olExp As Outlook.Explorer
    Dim olSel As Outlook.Selection

  7. #7
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    I would call those declarations rather than lines of code, but it's true they require the reference. The late binding equivalent looks like this (I've never needed Explorer or Selection, but I assume they would be similar):

    Code:
    Dim MyOutlook               As Object
    Dim MyMail                  As Object
    Dim MyAttachments           As Variant
    
    Set MyOutlook = CreateObject("Outlook.Application")
    Set MyMail = MyOutlook.CreateItem(0)  
    Set MyAttachments = MyMail.Attachments
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Ok thank you pbaldy, I will use this if needed. As of now, I was able to browse for the older outlook version library on my computer and use it. No one has had a problem with the older version... yet

    Thanks for the help though! Pretty soon, all employees will be moving to office 365, so this reference issue will only be for a short time.

  9. #9
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    No problem, good luck!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Another way to Auto Update of Front End
    By rankhornjp in forum Code Repository
    Replies: 23
    Last Post: 03-12-2014, 10:43 PM
  2. how to auto update a report ?
    By joe55555 in forum Access
    Replies: 5
    Last Post: 08-29-2013, 01:08 AM
  3. Auto Update Question
    By LionsCricket in forum Access
    Replies: 3
    Last Post: 04-11-2013, 03:22 PM
  4. Auto generate reference number
    By JonB1 in forum Import/Export Data
    Replies: 1
    Last Post: 02-19-2011, 06:38 AM
  5. Auto Update Forms
    By Vikki in forum Forms
    Replies: 1
    Last Post: 02-09-2010, 10:51 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums