Jump to content
Macro Express Forums

Getting "To" line of an email message using Get Control


Recommended Posts

I am attempting to get the value of the "To" line in an email message that's in my inbox. So I open the message and use Get Control to retrieve the text from the control. But the text keeps coming up blank. I can use Get Control to retrieve the "From" line (screenshot001), and the subject (screenshot002), but attempts to get text from the "To" or "cc" lines returns a blank string (screenshot003; actually I think single space). This worked perfectly for so long, but I haven't use the macro for a while and so can't know if an upgrade to MEP caused the change in behavior or something else. Can someone duplicate the behavior? Any ideas on what's wrong? Or even an alternate way to obtain the name/email of a recipient frmo an existing message in the inbox? Thanks. Jace

post-57-0-39504000-1306386771_thumb.jpg

post-57-0-96053500-1306386771_thumb.jpg

post-57-0-32759200-1306386773_thumb.jpg

post-57-0-02262200-1306386774_thumb.jpg

post-57-0-91194800-1306386774_thumb.jpg

post-57-0-56531600-1306386775_thumb.jpg

Link to comment
Share on other sites

Confirmed. I am using OL 2010 and the from control highlights fine but I can’t get the contents into a var. I can’t get To either. Only the subject works. Odd. Might want to contact ISS support on this one. Have no idea why that’s not working.

 

You could get this and many more values from the Internet Headers from the message properties. Alt>F>I>V in OL 2010. Just need to parse it out which isn’t difficult.

Link to comment
Share on other sites

Confirmed. I am using OL 2010 and the from control highlights fine but I can't get the contents into a var. I can't get To either. Only the subject works. Odd. Might want to contact ISS support on this one. Have no idea why that's not working.

 

You could get this and many more values from the Internet Headers from the message properties. Alt>F>I>V in OL 2010. Just need to parse it out which isn't difficult.

 

Oh, my problem isn't even quite that bad. I'm using OL 2007. I can highlight all the controls and capture the z-order w/ Get Control. My problem is just that it doesn't actually get the recipient off the "To" line. I can get "From" and "Subject" though. Will submit a report to ISS.

 

As always, thanks for the quick reply, and for the SMTP headers tip, Cory. Had not thought of that workaround.

Link to comment
Share on other sites

One problem you should be aware of is windows with identical titles and control handle confusion. Having multiple Message windows causes the handles to be randomly generated and the Get Control can look at the wrong window and remember the wrong handle. If you look back I had a big message thread on this some time ago. This might explain what you're seeing. Mention this to ISS when you start your support incident.

Link to comment
Share on other sites

Already submitted the incident, but I referred them to this thread. As an aside, I only had one message window open and confirmed in the debugger that the path to the control I was referencing was the same as the path to the control I was capturing. Couldn't get it to work i the debugger either. That's when I concluded I wasn't imagining things.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...