Results 1 to 7 of 7

Thread: Email via outlook object problem(RESOLVED)

  1. #1

    Thread Starter
    Junior Member J.J. JOHNSTONE's Avatar
    Join Date
    Aug 2002
    Location
    J'ville
    Posts
    19

    Email via outlook object problem(RESOLVED)

    This code works just fine for setting the necessary object and hiding the SendEmail button if Outlook is not installed but...

    if a user has Outlook installed but does not use it or have it set up there is a problem?

    One on my users running XP was forced into Outlooks setup wizard every time this code ran. Another user was held up for as much as 2 minutes for the same reason.

    How can I prevent this scenario from happening?

    I reallize what is causing the problem and can walk them through a solution but thats not really the point.


    Private Sub Form_Load()
    On Error GoTo ErrorHandler

    Set oLapp = CreateObject("Outlook.application")
    Exit Sub

    ErrorHandler:
    Set oLapp = Nothing
    cmdSendEmail.Visible = False
    End Sub
    Last edited by J.J. JOHNSTONE; Apr 14th, 2003 at 07:03 AM.
    J.J.


  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    If Outlook is not set-up correctly, then it can not be used for creating messages. If it is not set-up properly, then it will try to set itself up as soon as it starts up. If it is not set-up, it wont be able to send a message - as it has to know where to deliver the message (the e-mail server), and who it is from (the account or username who is using Outlook).

    If you want to send e-mails without using Outlook, then you can not use the Outlook Object. Instead, try using the SMTP protocol direct to an SMTP Server, using Winsock.

  3. #3

    Thread Starter
    Junior Member J.J. JOHNSTONE's Avatar
    Join Date
    Aug 2002
    Location
    J'ville
    Posts
    19
    I am aware that there is more than one way to skin the e-mail cat.

    Here is my goal. If a user has Outlook and it is setup, I enable the ability to e-mail output from my program otherwise output is print or file save only.

    I know of a way to tell if a user has it installed. But how can I find out if Outlook is setup and ready for use?
    J.J.


  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Don't know of a way to check for it, but why not just ask for confirmation from the user?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    What version of Outlook are your users using?
    You might be able to determine it, but I can't be sure.
    I will test when I get home from work.
    I know it will have to deal with the type of configuration Outlook is setup as.
    It will have to be either two of three configs.


  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    I found a way to detect if there is an email account setup in Outlook.
    In the registry there is a hive that contains the keys on all the user profiles
    for the current user logged in to the workstation.
    Query the registry hive and enumerate the keyus reading in the
    account information on each profile.
    If they have at least one and that one is a match for the Outlook
    logged on user then no issue or wizard popping up.
    If there is no key information then disable the sending of email
    for the user.

    Here is the key...
    HKEY_USERS\S-1-5-21-...-1202660629-1111\Software\Microsoft\Office\Outlook\OMI Account Manager\Accounts\00000001

    00000001 is the key for my first Outlook profile and the keys contain information like
    email address, reply address, etc.
    The only issue may be determining the SID# in the registry path matches the
    current Windows user logged on to the workstation.
    The sid is the S-1-5-21-..... part.

    I hope this helps.
    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

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Outlook\Setup
    and
    HKEY_USERS\S-1-5-21-...-1111\Software\Microsoft\Office\9.0\Outlook\Setup

    MailSupport=1

    This will tell you how Outlook is configured for Internet.
    Configuration 0 = No internet.
    Configuration 1 = Internet capable
    Configuration 2 = Exchange installation.
    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