UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Check If E-mail Is Opened, Access 2010    
 
   
Ice929rr
post Jan 14 2020, 05:35 AM
Post#1



Posts: 231
Joined: 19-July 06
From: Lisbon - Portugal


Hi all,

My app stores e-mails from outlook on a specific network folder.
But sometimes, the users forget to close the e-mail (not Outlook) and the access app crashes.

Is it possible to check if the specific e-mail is opened?

Thus preventing the error msg.

Tks in advance

LD
Go to the top of the page
 
GroverParkGeorge
post Jan 14 2020, 07:51 AM
Post#2


UA Admin
Posts: 36,754
Joined: 20-June 02
From: Newcastle, WA


When you say it crashes, does that really mean it fails and has to close?

Or does it mean an error is raised and your users see an error message?

Or something else?

If, as you imply, it means users see an error message, then perhaps the simplest approach would be to trap for that error in your error handler and handle it more gracefully.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
DanielPineault
post Jan 14 2020, 08:06 AM
Post#3


UtterAccess VIP
Posts: 7,129
Joined: 30-June 11



[del]Depends on what is going on exactly.

You can use error trapping to handle the error in a nicer manner.
You could loop through the Outlook Inspectors items to see what mail items are open.[/del]

Sorry missed the "(not Outlook)" part. You'll need to explain thing further please.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
FrankRuperto
post Jan 14 2020, 08:18 AM
Post#4



Posts: 633
Joined: 21-September 14
From: (MilitaryBrat) Tampa Bay, Florida, USA


QUOTE
the users forget to close the e-mail (not Outlook) and the access app crashes.


So the users forget to close the Access form that is opening the email and Access crashes, or throws an error message?

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix and Oracle DB's.
Go to the top of the page
 
GroverParkGeorge
post Jan 14 2020, 10:02 AM
Post#5


UA Admin
Posts: 36,754
Joined: 20-June 02
From: Newcastle, WA


Hm. I'm a bit confused:

"My app stores e-mails from outlook..."
"...the users forget to close the e-mail (not Outlook)..."

Are your users using Outlook or something else?

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
pere_de_chipstic...
post Jan 14 2020, 12:25 PM
Post#6


UtterAccess Editor
Posts: 10,537
Joined: 8-November 07
From: South coast, England


I read the OP as meaning that the user forgets to close the message window.

Not that the user forgets to close the Outlook application.

--------------------
Warm regards
Bernie
Go to the top of the page
 
GroverParkGeorge
post Jan 14 2020, 03:56 PM
Post#7


UA Admin
Posts: 36,754
Joined: 20-June 02
From: Newcastle, WA


You're probably right, Bernie. I prefer clarity over ambiguity and frequently feel the need to ask....

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
Ice929rr
post Jan 20 2020, 04:19 AM
Post#8



Posts: 231
Joined: 19-July 06
From: Lisbon - Portugal


Hi,

Sorry for the late reply.
So here's the thing.

First, I forgot to put an error trap... (my mistake)
Second, the aplication crashes because it sees that the e-mail that I want to save on the network is opened by Outlook.

I want to check if that specific e-ail is already opened by Outlook.

Once again, sorry for the late reply.

Cheers,
LD
Go to the top of the page
 
DanielPineault
post Jan 20 2020, 07:53 AM
Post#9


UtterAccess VIP
Posts: 7,129
Joined: 30-June 11



So then loop through the Outlook Inspectors items to see what mail items are open using Outlook automation.

Check to see if Outlook is running, if it isn't all is good so run your code. If it is then you need to use automation to loop through the Outlook Inspectors items to see if it is already open and act accordingly.

Another option would be to simply trap the error.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
ADezii
post Jan 20 2020, 10:55 AM
Post#10



Posts: 2,757
Joined: 4-February 07
From: USA, Florida, Delray Beach


I like Daniel's idea:
QUOTE
Check to see if Outlook is running, if it isn't all is good so run your code.

  1. Here is an approach to see if Outlook is even running. Whether is is Maximized, Minimized, or Restored it makes not difference. If it is indeed running, a non-zero Value will be returned by the apiFindWindow() Function.
  2. Required Declaration:
    CODE
    Declare Function apiFindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal strClassName As String, ByVal lpWindowName As Any) As Long
  3. Code Definition:
    CODE
    If apiFindWindow(CStr("rctrl_renwnd32"), 0&) = 0 Then
      MsgBox "Outlook is NOT running!"
    Else
      MsgBox "Outlook IS running!"
    End If
  4. The first Argument passed (CStr("rctrl_renwnd32")) is simply the Class Name for Microsoft Outlook.

This post has been edited by ADezii: Jan 20 2020, 10:56 AM
Go to the top of the page
 
Ice929rr
post Jan 21 2020, 07:59 AM
Post#11



Posts: 231
Joined: 19-July 06
From: Lisbon - Portugal


Tks all

For now, I'll trap the error.

Tks again

LD
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th February 2020 - 05:51 AM