Cory Posted February 14, 2007 Report Share Posted February 14, 2007 Essentially: I want to create a macro that will file an Outlook 2003 mail message to file. I want to use the message date and subject in the file name. With a single mail message open it was simple to get the control text to do this. But with multiple windows I sometimes get blank values for the controls. How can I get this to work with multiple windows? Long winded: I don’t understand something about windows controls. If you have calculator.exe open and interact with controls, even when minimized or not on top, it’s just like the demos but how do you deal with two instances of calculator open? In Outlook a user could have several editor/viewer windows open but when I run the “Get control” from two open windows I don’t see any difference. <GETCONTROL2P:01:OUTLOOK.EXE:rctrl_renwnd32 Title1 - Message (HTML) 003:7 AfxWndW 1 #32770 5 RichEdit20WPT > <GETCONTROL2P:01:OUTLOOK.EXE:rctrl_renwnd32 Title2 - Message (HTML) 003:7 AfxWndW 1 #32770 5 RichEdit20WPT > Windows must know the difference, how do I? Example: I opened a message and set up a control to grab the date. Works great. I open a second message and run the control and even if the new message is on top the macro returns the contents of the first window. Kind of makes sense. If I close the first message and run it again it returns a blank field. Now if I close the second message and open it again as the first window the macro will grab the control text fine. It’s almost like it IDs them one at a time as they are being opened and my get control it slaved to the first open window. But I don’t see anything different in the get control. I was thinking of a workaround to ensure they only had one window open but even there I would have a problem. If the mail message wasn’t the first they opened it won’t work! <g> If someone could explain what I am missing here I would greatly appreciate it. Also if you have any suggestions in general to do what I’m trying to do please bring it on. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.