OUTLOOK New Mail Field Availability

Status
Not open for further replies.
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 = "smysds@safdty.net"

myItem.Recipients.Add ("muadsm@safdty.net")

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
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Some properties aren't available before the first Inspecor_Activate event.

Best regards

Michael Bauer

Am Fri, 2 Apr 2010 11:59:02 -0700 schrieb 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 = "smysds@safdty.net"
> myItem.Recipients.Add ("muadsm@safdty.net")
> 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
 
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?

Sue Mosher

"Martin" wrote:


> 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 = "smysds@safdty.net"
> myItem.Recipients.Add ("muadsm@safdty.net")
> 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

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.

"Sue Mosher [MVP]" wrote:


> 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?
> > Sue Mosher
> > >

> "Martin" wrote:
>
> > 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 = "smysds@safdty.net"
> > myItem.Recipients.Add ("muadsm@safdty.net")
> > 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Gmail mail is being delivered to a different email inbox in Outlook App 2021 Using Outlook 2
D Outlook 2003 Mail Fails Using Outlook 1
P Importing other e-mail accounts into Outlook Using Outlook 1
F Excel VBA to move mails for outlook 365 on secondary mail account Outlook VBA and Custom Forms 1
M Convertor for Outlook Express Mail Store (.dbx) to Outlook Mail Store (.pst) Using Outlook 0
T Outlook creates a copie of every mail I send Using Outlook.com accounts in Outlook 4
M Outlook 2010 How could I globally redesign an outlook template form/region/inspector template used to display mail lists or an individual mails? Outlook VBA and Custom Forms 0
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
R How to Sync *all* Google Workspace Mail Folders with Outlook 2019 (MS365) Using Outlook 3
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
S Outlook email to configure setup for each mail Outlook VBA and Custom Forms 1
S Outlook mail adressing stops after first match in GAL Using Outlook 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
ThinkToday Calculate reply time of outlook mail Using Outlook 1
GregS Why is Outlook 2016 mail in Outlook.com? Using Outlook 1
S Outlook not receiving mail Using Outlook 1
Commodore Outlook (2013) issues with icloud.com mail Using Outlook 0
GregS Outlook 2016 iPhone won't download Outlook 2016 Mail. Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
H In outlook 365 POP mail Inbox, email takes a long time or never arrives. Using Outlook 1
B Outlook - Mail from safe senders list being sent to Spam Folder Using Outlook 0
H Outlook 2016 sent over 30 copies of an e-mail with attachments Using Outlook 1
A Outlook macro to create search folder with mail categories as criteria Outlook VBA and Custom Forms 3
P when i move inbox mails to another folder in outlook the mail disappears Using Outlook 1
E Copy e-mail body from outlook and insert into excel Outlook VBA and Custom Forms 3
soadfan Outlook won't send e-mail when offline Outlook VBA and Custom Forms 19
M Duplicate Primary Mail Accounts outlook 2010 Using Outlook 0
H Custom autoforwarding, sending mail through outlook office 365 Using Outlook 1
J Copy or Export Outlook Mail to Excel Outlook VBA and Custom Forms 6
stephen li VBA Outlook send mail automatically by specified outlook mail box Outlook VBA and Custom Forms 1
T Changing default Mail Account in Outlook 2016 - POP3 Using Outlook 1
J Problem with Outlook 2016 new mail tray icon alert (envelope in the systems tray) Using Outlook.com accounts in Outlook 0
T Probem with junk mail folder in new account in Outlook Using Outlook 0
GregS Outlook mail arrives in batches, sometimes hours late Using Outlook 1
T outlook 2010 mail item count doesnt match display Outlook VBA and Custom Forms 3
T Outlook 2016 cannot connect after transition to Outlook Mail Using Outlook.com accounts in Outlook 4
N Outlook People Pane - Sent Mail Using Outlook 1
L pin to Outlook move mail Using Outlook 2
M Outlook Mail Using Outlook 3
Diane Poremsky Junk Mail Filtering in Outlook Using Outlook 0
I Collecting mail address from GAB and adding to Outlook Task Using Outlook 2
Diane Poremsky Internet Mail Issues with Outlook Using Outlook 0
Diane Poremsky Mail Issues with Outlook Using Outlook 0
Diane Poremsky Error Opening Outlook and Control Panel's Mail Applet Using Outlook 0
Diane Poremsky Outlook 2013: Control Panel Mail Won't Open Using Outlook 0
T Create Rule For Secondary E-Mail Address In Outlook 2016 Using Outlook 4
billzant Windows 10 Outlook 16 and mail not working, encryption? Using Outlook 3
F Outgoing mail from Outlook.com sticks in Drafts folder Using Outlook 0
M Outlook 2016 - Mail Not Syncing With iPhone Outlook App Using Outlook 1

Similar threads

Top