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
> Outlook Browse For Email Item, Any Version    
 
   
Schizolocal
post Feb 6 2019, 03:18 AM
Post#1



Posts: 281
Joined: 22-March 06
From: St.Helena


Hi
I am doing some work on automating Outlook and interacting with Access via VBA. I have discovered the namespace.PickFolder method for bringing up an Outlook dialog to allow the user to browse for, select and return a reference to an Outlook folder, but I am stumped with finding an equivalent function for returning a reference to a selected Item (I am specifically looking at Email items, but I would imagine that any solution would apply to any item type). So, in summary...
Is there any Outlook mechanism, callable from VBA, which allows a user to browse for and select an Item modally, and return a reference to the selected Item object?

Stuart

--------------------
Opinions expressed that happen to coincide with
those of my employer, are mine. I work for myself.
Go to the top of the page
 
DanielPineault
post Feb 6 2019, 05:42 AM
Post#2


UtterAccess VIP
Posts: 6,974
Joined: 30-June 11



I think you're going to have to use .Selection and iterate through the returned items. See: https://docs.microsoft.com/en-us/office/VBA....selection.item

--------------------
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
 
Schizolocal
post Feb 6 2019, 08:45 AM
Post#3



Posts: 281
Joined: 22-March 06
From: St.Helena


Thanks for the reply, Daniel.
I've sort of imagined I could do something of the sort, but (if my understanding is correct) it would mean that the selection of the email item in Outlook and the prompt and handling of the selection in Access proceed aysnchronously, i.e. my Access VBA invites the user to switch to Outlook, select the email s/he is interested in, return to Access (which has been waiting for a proceed command from the user), which then handles the selection.
I've a feeling I can make it work, but it is cumbersome.

Am I right?
Is there no way of doing something like displaying the correct Inspector and managing it's behaviour? (my other blue-sky thinking idea)
Stuart




--------------------
Opinions expressed that happen to coincide with
those of my employer, are mine. I work for myself.
Go to the top of the page
 
DanielPineault
post Feb 6 2019, 08:53 AM
Post#4


UtterAccess VIP
Posts: 6,974
Joined: 30-June 11



From my knowledge, there is no way to prompt the user to select a e-mail. Outlook only provide a FolderPicker. It's a real pain. I seen people create their own forms, and read the subjects, etc... to populate their form so they can achieve a better selection process then what is possible directly through Outlook automation.

--------------------
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
 


Custom Search


RSSSearch   Top   Lo-Fi    20th November 2019 - 05:00 AM