Test if Outlook is setup for current user using VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    Test if Outlook is setup for current user using VBA

    Is there a way to test if MS Outlook is setup for the current user via VBA from Access? My plan is to create an email through Access and have it open so that the user can preview it. The user can then send it. Most our users have outlook, but if their computer is being worked on, we give them a spare computer and have them use the web mail, so code to compose an email wouldn't work (unless it is possible to code into Outlook Web App). Unfortunately, all of our systems have Outlook installed, so I can't just test for the existence of the file. I would need to see if the user is setup in Outlook.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Do you mean that they log into those systems with a different user name rather than the one they normally use?

    Comment

    • Seth Schrock
      Recognized Expert Specialist
      • Dec 2010
      • 2965

      #3
      No. The username would stay the same.

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        Rabbit, I betcha that they don't have Outlook installed on the loaner; thus, the web based login.

        We used to do the same thing at my company... often with laptops... for a temp PC. However, now they have somehow cloned the local PC drives to the network... scarrrrrrrrrrry y(!) and they just push a copy to a new PC and plug-n-play with the damaged one!

        Seth, the problem is that there is not an easy way to determine what login was used with the web based email portal which is somewhat the point.

        This may be a case where you use CDO.

        Comment

        • Seth Schrock
          Recognized Expert Specialist
          • Dec 2010
          • 2965

          #5
          Actually, Outlook is installed, but the user isn't setup on the loaner so it isn't used. That is why I can't just test if Outlook is installed. As for cloning the local PC drives to the network, everyone's My Documents folder is actually stored on the network and not on the local PC so that they can go from PC to PC and still have their documents.

          At this point, I don't care what logon was used for the web based email. I just want to know if Outlook is setup for the current user. I already have the function to get the current user and I have the email address as well if that helps. My idea is that if Outlook is setup, then I will just open the email in Outlook. If Outlook isn't setup, then I will just save the report as a PDF and then let the user attach it to the email. About 99% of the time, Outlook will be available. I just don't want my database to break if they get a spare while theirs is getting worked on. Does that make sense? I don't want the email to be sent automatically as other documents sometimes need attached as well. Can CDO do this?

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            I bet there's a registry key that contains the account that is set up. I would do a registry search for outlook and see if you can identify the key. Then you can check for that key on the other computer.

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #7
              Rabbit,
              Couldn't you do that with WMI?
              Reading thru your tutorial and the related material it seemed that one could check for that kind of information?

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                Yes, you could use WMI to check for the key. If that is where Outlook stores that information. I don't know for certain that it is stored there but it wouldn't surprise me if it were.

                Comment

                • TheSmileyCoder
                  Recognized Expert Moderator Top Contributor
                  • Dec 2009
                  • 2322

                  #9
                  Could you simplify your issue, and simply check if they are using "loaner" pc? Is there anything that identifies the loaner pc as such?

                  Comment

                  • Seth Schrock
                    Recognized Expert Specialist
                    • Dec 2010
                    • 2965

                    #10
                    Actually, in this case I think that all of my users for this database would have the computer name be the same as their user name if it was their PC. So I guess I could test for the computer name and if they match, then use outlook.

                    Comment

                    Working...