Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clipboard to Mail item body property
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00967519
Message ID:
00968477
Vues:
22
This message has been marked as the solution to the initial question of the thread.
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
*Probably it takes some time for window to appear.

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}")  && 	try {TAB}s if this does not work
4. Here is the example of inserting picture from file
    oShell.SendKeys("%IP")  	&& activate Insert Picture Dialog
    oShell.SendKeys("c:\personal\alko.gif{ENTER}") && Insert picture from file

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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform