Good day,
I have a from on which I have an (ID) field.
is it possible to have a button on my form by which I can create a folder in Ms outlook with the same (ID) on my form
Best Regards
Good day,
I have a from on which I have an (ID) field.
is it possible to have a button on my form by which I can create a folder in Ms outlook with the same (ID) on my form
Best Regards
Yes.
Are you referring to a mail item folder?
yes.
Regards
You need to code some VBA behind the buttons 'Click' event. Such code is called an event handler. Before I help you with this could you tell me how experienced you are with VBA and event handlers. Meanwhile here is some rough pseudo code of what needs to be done.
- Examine ID value on form. If null or blank then do nothing/exit. Otherwise trim value, etc.
- Create an object variable reference to the Outlook application. If Outlook is already loaded/open then set the reference to this occurrence. Otherwise create a new Outlook application occurrence. (Outlook application created from Access will be hidden.)
- Examine Outlook mail item folders to see if ID already exists. If it does show message and jump to step 5
- If no existing folder then create a new one. Confirm creation to user.
- If Outlook application was created by this event handler then close application. Otherwise leave Outlook application loaded and open as found.
It is also essential that you include an error handler that makes Outlook visible if any error occurs. It is not good if somehow you end up with more than one Outlook application occurrence and even worse if one or more of these occurrences is hidden.
thanks Rod
Not exactly the answer I was expecting.
Before I help you with this could you tell me how experienced you are with VBA and event handlers.