Categories in emails

Dan25e

Registered User.
Local time
Today, 14:22
Joined
Dec 3, 2014
Messages
33
Peeps,

Is it possible to send an email from an access 2007 database with a category?

Cheers
Dan
 
Do you mean when the recipient receives the email you can dictate which category it goes into? Because if that's what you mean that doesn't sound right to me, I would have thought the recipient has control over the categories not you!
 
If you wanted to send an email to yourself and have it go into a particular category then that might be possible, because you could add coding information into the actual email address.
 
Users are often swamped with emails during the normal working day and as such have requested that emails sent from the database either have the email subject as a coloured font as seen in Outlook or better still a category be assigned.

I am not after personal control over anyone's inbox but the process I have replicated and embodied into a database format needs to be as distinct as the old paper based process, one aspect of which is instead of an A4 yellow piece of paper in an in-tray a yellow coloured category in an inbox.
 
Have a look at this Outlook VBA code HERE:- http://www.slipstick.com/developer/create-a-new-message-using-vba/

Code:
Public Sub CreateNewMessage()
Dim objMsg As MailItem
 
Set objMsg = Application.CreateItem(olMailItem)
 
 With objMsg
  .To = "Alias@domain.com"
  .CC= "Alias2@domain.com"
  .BCC = "Alias3@domain.com"
  .Subject = "This is the subject"
  .Categories = "Test"
  .VotingOptions = "Yes;No;Maybe;"
  .BodyFormat = olFormatPlain ' send plain text message
  .Importance = olImportanceHigh
  .Sensitivity = olConfidential
  .Attachments.Add ("path-to-file.docx")
 
' Calculate a date using DateAdd or enter an explicit date
  .ExpiryTime = DateAdd("m", 6, Now) '6 months from now
  .DeferredDeliveryTime = #8/1/2012 6:00:00 PM#
   
  .Display
End With
 
Set objMsg = Nothing
End Sub

This line suggests you "Can" change the categories, BUT, I reckon it would be your own email account category. Still run the code and let me know what happens, I'd like to know!

Code:
  .Categories = "Test"
 
Thanks Uncle Gizmo.

Problem is when I compile I get an method or data member not found error pon the bold and underlined...

Set objMsg = Application.CreateItem(olMailItem)

Any ideas? Is it a references thing?
 
Actually I googled about and found this

https://msdn.microsoft.com/en-us/library/office/aa220082(v=office.11).aspx

From which I extracted this...

Private Sub...()
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application

With objMail
.To = [a control]
.BCC = "email address"
.Importance = olImportanceHigh
.Subject = "This is a " & Me.Control & " Test Notification "
.BodyFormat = olFormatRichText
.Body = "This is a " & Me.Control & " Test Notification "
.Categories = "Test"
.Display
End With

Popped in amongst the rest of the code for an OnClick event. Works a treat!
 
Except it doesn't!

The old method I used to send emails was the DoCmd.SendObject method and the database would 'wait' until the email was sent before running the next piece of code. In most cases it was a DoCmd.SaveRecord (important for some auditing code I have running) and then set a value or two in other controls. If I chose not to send the email, the database would do nothing which is what I want it to do.

Using the new method the database reports that the save record function 'isn't available now' and whether I send the email or not it executes the rest of the code.

Do I need to make this method into a separate module and 'call' it? And how would I get it to behave the same way as the DoCmd.SendObject method?
 
That is an altogether different issue. Start a new thread.

(as to your original issue - it would surprise me greatly if the RECIPIENT had the mail categorised according to YOUR category).
 

Users who are viewing this thread

Back
Top Bottom