dcsimg
Results 1 to 5 of 5

Thread: MS Access Database Outlook 2016 VBA issue

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2019
    Posts
    2

    MS Access Database Outlook 2016 VBA issue

    VBA issue may not be the correct description for this but I will try and break it down as simply as I can

    - I have a Microsoft Access database where I have a form with various text fields and drop downs

    - once this form is filled a user hits the send email button where it opens up a new email window where it plants the email its going to , the cc'ed users , the subject , body of the email and so forth.

    - User hits send email.

    -Outlook pops up in the windows Tray and disappears.

    -All looks well to the end user and would for no reason expect that their email did not go through.

    Much to my disbelief when all of this occurs. It is not actually sending the email unless I actually have Outlook running all its doing is putting my message in my outbox.

    In order for my email to send (which is very important to send asap) I need to be sure I open outlook for it to move out of the outbox and actually send

    This is a major issue because this email is time sensitive and does require to be received as soon as possible and with users not being aware of this or savvy enough to know this I need to try and force this to occur and more importantly to then make sure people are not shutting it down before the mail account is allowed to sync. These mail accounts are hooked to an exchange server.

    Does anyone here have any ideas in regards to this issue or is it a possible loss cause?

    Thanks for your time.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,628

    Re: MS Access Database Outlook 2016 VBA issue

    you should easily be able to open outlook if it is not already running

    but i doubt you can stop a user from closing it again, though i fail to see why any user would close outlook unless they are shutting down windows
    in outlook, there is an application.quit event, but no provision to cancel the process

    you could use various APIs (or other methods) with a timer to determine if outlook is open already, or if it not still open then reopen

    there are other options to send email messages, without relying on outlook at all, i use cdo.message to send emails, a down side of that is that it does not go to the outbox then sent items of whatever email client you use, i send a bcc to myself for records, which then come to my inbox folder or a folder selected by rules

    there are several outlook features that could be tested to see if they might help, but outlook would have to be automated to do that
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2019
    Posts
    2

    Re: MS Access Database Outlook 2016 VBA issue

    Quote Originally Posted by westconn1 View Post
    you should easily be able to open outlook if it is not already running

    but i doubt you can stop a user from closing it again, though i fail to see why any user would close outlook unless they are shutting down windows
    in outlook, there is an application.quit event, but no provision to cancel the process

    you could use various APIs (or other methods) with a timer to determine if outlook is open already, or if it not still open then reopen

    there are other options to send email messages, without relying on outlook at all, i use cdo.message to send emails, a down side of that is that it does not go to the outbox then sent items of whatever email client you use, i send a bcc to myself for records, which then come to my inbox folder or a folder selected by rules

    there are several outlook features that could be tested to see if they might help, but outlook would have to be automated to do that
    Thanks for the reply, are you saying you posted code in your message? I'm not seeing?

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,628

    Re: MS Access Database Outlook 2016 VBA issue

    are you saying you posted code in your message
    no, i did not say that

    i just made some suggestions you could follow up on, if you decide to go for a specific one i may be able to help with code, but i can not test what will actually work for you as there may be differences between outlook and windows versions and while i often send emails by code i do not use outlook for that, and have never struck you particular problem when i have sent out emails, by code, using outlook, but that has mostly been sending one offs, for multiples i have been using CDO
    Last edited by westconn1; Jun 9th, 2019 at 05:31 PM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: MS Access Database Outlook 2016 VBA issue

    after you .send I think there is an extra option to force a resend. Check the application force refresh or send.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width