Gregorio
The idea is to display the message, set the body format to html or richtext if needed (that accept paste from Word, pictures, etc.), activate the window and hit the hot keys responsible for paste.
1.Display the message and set the body format
oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(MAILITEM)
Just in case, make sure it is not minimized:
oOutLookObject.ActiveWindow.WindowState =0
WITH oEmailItem
.To = ...
.Subject = ...
.htmlbody = "<HTML><H2>This is HTML Mail.</H2><BODY>Some body text.</BODY></HTML>"
.Display
2. Activate the window.
oShell = CreateObject("WScript.Shell")
IF oShell.AppActivate(loOutlook.ActiveWindow.caption)
3. set the mouse cursor in the body area
oShell.SendKeys("^{END}")
4. Here is the example of inserting picture from file
oShell.SendKeys("%IP")
oShell.SendKeys("c:\personal\alko.gif{ENTER}")
ENDIF
......
>Yuri:
>
>I'm sure that there some command to jump from the "To" line to the body section. But i dont find anything that talk about that. Maybe Marcia Akins can help. So I prefer that you explain more about your oshell technic.
>
>Something is missing from the previous message where you make reference to the following code,
>
>oShell = CreateObject("WScript.Shell")
>
>if I use your code this way I get the {tab} command inside of the VFP command line I am testing so I using the command line to send command to the open e-mail item but from the previous command something was not told and I am lost. Can you give more detail how you point the oshell object to the e-mail item windows.
>
>Thank for your help. I can send 10 {tab} in sequence. That does not going to damage my application because i can use the commandbar to remove the excess of {tab} and then insert my document.