OUTLOOK New Mail Field Availability

M

Martin

I have code when invoked on a new mail item with subject = 3089 and cursor
left in subject field that acts differently (in debugging) when locals myItem
is expanded or not. When not expanded, sr_number ="", when expanded,
sr_number ="3089".

How can I accomplish the assignment? It appears the information exists,
just how to get to it??
-----
Public Sub SSP_Req_Notification()
Dim initialSubj, finalSubj As String
Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Dim myRecipient As Outlook.Recipient
Dim sr_number As String
Dim myItem As Outlook.MailItem

Set myItem = Application.ActiveInspector.CurrentItem
sr_number = myItem.Subject '1
sr_number = myItem.Subject '2
sr_number = myItem.ConversationTopic '3
sr_number = myItem.TaskSubject '4

myItem.SentOnBehalfOfName = "(e-mail address removed)"
myItem.Recipients.Add ("(e-mail address removed)")
myItem.Recipients.Add ("jy. mias")

Exit Sub
----------------------------
After execution of line tagged '1
: sr_number : "" : String
After expanding myItem in locals window and execution of line tagged '2
: sr_number : "3089" : String
Display of myItem.subject after expanding
: Subject : "3089" : String
 
M

Michael Bauer [MVP - Outlook]

Some properties aren't available before the first Inspecor_Activate event.

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
<http://www.vboffice.net/product.html?lang=en>


Am Fri, 2 Apr 2010 11:59:02 -0700 schrieb Martin:
 
S

Sue Mosher [MVP]

A value entered manually isn't assigned to a property until the focus moves
off the associated control. Expanding myItem is probably what does that in
your scenario, as would saving the item.

What exactly are you trying to accomplish here?
 
M

Martin

Well, my attempt was to retrieve the number from the subject field, open and
retrieve additional information from associated documents (via number), and
format the message details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top