none
Standard message form and its data RRS feed

  • Question

  • Hi All

    When an Outlook message form is displayed what is it's data source?  If I set an outlook mailitem to the current inspector active item then shouldn't this object be the source of the data that is appearing on the form?  My dilemma is trying to set the "to" field on the "send" form which all evidence says is the "senderemailaddress" data field property of the "mailitem" object - the one I am thinking is the data source for the form.  The senderemailaddress is blank because this message is a web request message. The sender's email address is in the body of the email which I do extract but I cannot assign it to the senderemailaddress field because it is read only.  I don't want to use an RDOmail object because this requires an independent form display which opens up another plethora of problems!  Is it possible to update a safemailitem's (created from the mailitem) senderemailaddress (it's not read-only) and somehow create a new mailitem from the safemailitem with the assigned senderemailaddress and thus have my "to" field populated with the "requestor's" email mail address?  So far my code sequences have failed - gee imagine that!

    Respectfully,

    Gordon Haas


    Gordon Haas

    Tuesday, March 12, 2013 3:43 PM

Answers

  • I'd refer to it as telling Outlook something has changed without making any other alterations or changes to the item. What I had said many of use was something like this:

    _mail.Subject = _mail.Subject

    That isn't quite the same as setting a mail item to itself.

    Wat I'm doing is setting Subject to itself. No further changes are made, it just fakes Outlook into thinking something has changed. Then the save is used to commit the changes from the underlying MAPI item to the in-memory cached item Outlook has.

    It's not a question of permanent or temporary objects, it's that changes made in one API may not be reflected in a different API unless the second API is notified of changes made in the first API.


    Ken Slovak MVP - Outlook

    • Marked as answer by saahg Thursday, March 14, 2013 6:24 PM
    Thursday, March 14, 2013 5:22 PM
    Moderator

All replies

  • Never mind everybody, I have been working this problem too long and from too many "angles".  It is the RDOmail "sendereamiladdress" field that is modifiable - I am going to have to build a com add-in it looks like.  For the sake of knowledge, however, is my first part of the question correct - that is the data on the Standard "send" form which is displayed by "Outlook" uses the data in the active inspector Outlook mailitem?

    Respectfully,

    Gordon Haas


    Gordon Haas

    Tuesday, March 12, 2013 3:59 PM
  • I've no idea what you wanna do.

    >My dilemma is trying to set the "to" field.

    You can assign the recipient's email address to MailItem.To Property.

    Thursday, March 14, 2013 1:02 PM
  • Thanks for the response Wilson.

    Setting the mailitem.to field changes the to "field" in the original message (if I save it after I set it) - it does not change the data displayed in the Outlook Standard "send" message form "to field" at send time.  This brings me to the "real" question - is there documentation on the form fields and the data that is referenced in the various mail items (mail, safe, rdo, etc) displayed in those fields.  For example if I change the SenderEmailAddress field in the RDOMail item it does not change the data displayed in the "From" field on the Outlook form.  If I change the data in the SentOnBehalfOfEmailAddress field it does.  It would be really helpful if such a document existed.  I hope this clarifies the request.  Again thanks for the response.

    Respectfully,

    Gordon Haas


    Gordon Haas

    Thursday, March 14, 2013 1:43 PM
  • There's no real documentation like you want. All the documentation for Redemption is on Dmitry's site.
     
    In general, changes made using Redemption (or Extended MAPI) won't be reflected directly in Outlook unless Outlook knows about the change. It automatically knows about changes made to objects using the OOM (Outlook object model).
     
    What many of us do to let Outlook know that something has changed so it reloads its cache of the object is something like this, where _mail is an Outlook.MailItem where the same RDOMail object has just been changed in some way:
     
        _mail.Subject = _mail.Subject
        _mail.Save()

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "saahg" <=?utf-8?B?c2FhaGc=?=> wrote in message news:62a89d19-3092-4edd-94ed-5dff86c971e8...

    Thanks for the response Wilson.

    Setting the mailitem.to field changes the to "field" in the original message (if I save it after I set it) - it does not change the data displayed in the Outlook Standard "send" message form "to field" at send time.  This brings me to the "real" question - is there documentation on the form fields and the data that is referenced in the various mail items (mail, safe, rdo, etc) displayed in those fields.  For example if I change the SenderEmailAddress field in the RDOMail item it does not change the data displayed in the "From" field on the Outlook form.  If I change the data in the SentOnBehalfOfEmailAddress field it does.  It would be really helpful if such a document existed.  I hope this clarifies the request.  Again thanks for the response.

    Respectfully,

    Gordon Haas


    Gordon Haas


    Ken Slovak MVP - Outlook
    Thursday, March 14, 2013 2:42 PM
    Moderator
  • Thanks Ken for the feedback.

    For the sake of "being on the same page" let me define what I think you are saying.

    Step 1:  I change something in an RDOmail object which is a "reflection" of the mailitem.

    Step 2: I reload memory by an identity assignment of mailitem = mailitem.

    Step 3: I transfer the changes back to the "permanent copy" of the mailitem with the save command.

    If this is true then this is saying that when any "associated" item, i.e. safemailitem, is updated if I perform this identity assignment then the "Outlook" mailitem will reflect the changes of the "associated" item (with the exception of read only fields - I assume).

    Again if this is what you are telling me then this does turn on light bulbs but there is still a lot of darkness with regards to the Form fields to item data mapping!  Additionally, all my experiments have shown that when Outlook displays the form it is always referencing the Outlook mailitem for the data.  In order to produce a form with reference to the "RDOMail Item" (for instance) you must execute the rdomail.display command which then opens the door for possible successive form displays!

    Respectully,

    Gordon Haas


    Gordon Haas

    Thursday, March 14, 2013 5:01 PM
  • I'd refer to it as telling Outlook something has changed without making any other alterations or changes to the item. What I had said many of use was something like this:

    _mail.Subject = _mail.Subject

    That isn't quite the same as setting a mail item to itself.

    Wat I'm doing is setting Subject to itself. No further changes are made, it just fakes Outlook into thinking something has changed. Then the save is used to commit the changes from the underlying MAPI item to the in-memory cached item Outlook has.

    It's not a question of permanent or temporary objects, it's that changes made in one API may not be reflected in a different API unless the second API is notified of changes made in the first API.


    Ken Slovak MVP - Outlook

    • Marked as answer by saahg Thursday, March 14, 2013 6:24 PM
    Thursday, March 14, 2013 5:22 PM
    Moderator
  • Yes Ken I missed the fact that it was only the "subject" - why I don't know.

    I understand what you are saying - its a refresh game.  What about the "read only" aspect of some of the mailitem fields - not updated?

    Respectfully,

    Gordon Haas


    Gordon Haas

    Thursday, March 14, 2013 6:31 PM
  • Some read-only properties in the OOM are not read-only to Redemption or Extended MAPI, before the first save on the item. After the item has been saved at least once those properties are read-only. An example of this is the Sender* properties such as SenderEmailAddress or SenderName.
     
    Other properties are read-only even to Redemption, and others are read-only only for the OOM. In some cases Outlook applies its own "business logic" to render certain properties read-only to its object model (even PropertyAccessor), but Redemption and Extended MAPI do not apply that logic and those properties are read/write to those API's.
     
    Each API has its own rules. Some are well documented, some are documented only obscurely and others are not documented at all and only experience and folk wisdom tell you if you can work with them (or the code errors <g>).

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "saahg" <=?utf-8?B?c2FhaGc=?=> wrote in message news:388c69db-d337-4944-ab39-747238ef0d3c...

    Yes Ken I missed the fact that it was only the "subject" - why I don't know.

    I understand what you are saying - its a refresh game.  What about the "read only" aspect of some of the mailitem fields - not updated?

    Respectfully,

    Gordon Haas


    Gordon Haas


    Ken Slovak MVP - Outlook
    Thursday, March 14, 2013 7:39 PM
    Moderator