![]() |
|
|
|
#1
|
|||
|
|||
|
I am new to trying to modify the Office Suite but have some past experience in other products. If you can help me with a response, please keep it on a kindergarten level because that is where I am currently.
I would like to add a custom field (Case Code) to every Outlook email which identifies the case / project to which the email is connected. If I modify my emails to include and display this field: 1. Will an incoming email default to my customized design so that I can add the case code? 2. If I have completed this field in an outgoing email, will receipt of the reply email already contain the data in the field? (I assume it will). 3. It is my plan to use my email in conjunction with a companion dbase set up in Access. I know I can create a list of responses in an Access table which can be used to lookup a value in another Access table. Can that Access table be access by an Outlook email form? Example: An Access table includes two fields, the Case Code and the Case Reference. When clicking on the Case Code field in the Outlook email form, can it be linked to the Access table to choose from a list of valid case codes and then populate the field in my email? Thanking you in advance, Rachael |
|
#2
|
||||
|
||||
|
The short answer is 'no'.
You have no control over your clients' e-mail applications. You have no control over the incoming e-mail formats - with plain text having no compatibility with fields. If you add material to messages, you damage their evidential value in the event of a future legal action. In theory you can add to an e-mail message, either incoming or outgoing using a macro (or in the case of incoming a script attached to a rule), but I would avoid fields. At its simplest it would be as follows, but you could replace the reference input box with a lookup to the Access table. Open a new (or existing) message and run the Test macro. Code:
Sub Test()
Dim olMsg As MailItem
On Error Resume Next
Select Case Outlook.Application.ActiveWindow.Class
Case olInspector
Set olMsg = ActiveInspector.currentItem
Case olExplorer
Set olMsg = Application.ActiveExplorer.Selection.Item(1)
End Select
AddData olMsg
Set olMsg = Nothing
End Sub
Sub AddData(olItem As MailItem)
'Graham Mayor - https://www.gmayor.com - Last updated - 07 Jul 2021
Dim olInsp As Outlook.Inspector
Dim wdDoc As Object
Dim oRng As Object
Dim sCase As String, sRef As String
sCase = InputBox("Enter the case number")
sRef = InputBox("Enter the reference number")
With olItem
.BodyFormat = olFormatHTML
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor
Set oRng = wdDoc.Range
oRng.collapse 1
oRng.Text = "++++++++++++++++ Admin use only ++++++++++++++++++++" & vbCr & vbCr & _
"Case: " & sCase & vbCr & "Reference: " & sRef & vbCr & vbCr & _
"++++++++++++++++++++++++++++++++++++++++++++++++++" & vbCr & vbCr
oRng.collapse 0
oRng.Select
End With
lbl_Exit:
Set olInsp = Nothing
Set wdDoc = Nothing
Set oRng = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Custom fields formula
|
fragono | Project | 2 | 03-02-2016 11:03 AM |
Custom fields used in the Compare Function
|
OTPM | Project | 3 | 03-02-2015 06:43 AM |
| Contact custom fields not showing | Hmcrunchy | Outlook | 0 | 08-28-2013 03:54 AM |
Tasks Import ( Custom fields)
|
VidyaR | Outlook | 1 | 02-13-2013 07:01 AM |
| Stumped on Grouping with Custom Fields... | ViperMan | Project | 1 | 06-22-2011 01:31 AM |