Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bring window to front screen
Message
De
23/09/2010 16:26:43
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01482415
Message ID:
01482479
Vues:
67
It's always impossible to guess what name someone else uses for a variable. My guess is to replace oMailItem with loItem.

>hi sergey - error - not found omailitem - i've obviously not applied it comrrectly. Please bear with me.
>here is the whole code i am using (borrowing). can you let me know how to adapt your suggestion and apply it to my situtation and i will give it another go.
>thanks for your patience. K
>
>PROCEDURE Send1ViaOutlook(tcReturn, tcTo, tcSubject, tcBody, taFiles, tcCC, tcBCC, tlHTMLFormat, tnImportance, tlOpenEmail)
> *******************************************
> LOCAL loOutlook, loItem, lnCountAttachments, loMapi
> TRY
>  loOutlook = CREATEOBJECT("outlook.application")
>  loMapi = loOutLook.GetNameSpace("MAPI")
>  loMapi.Logon()
>  loItem = loOutlook.CreateItem(0)
>  WITH loItem
>   .Subject = tcSubject
>   .TO = tcTo
>   IF tlHTMLFormat
>    .HTMLBody = tcBody
>   ELSE
>    .Body = tcBody
>   ENDIF
>   IF TYPE("tcCC") = "C"
>    .CC = tcCC
>   ENDIF
>   IF TYPE("tcBCC") = "C"
>    .BCC = tcBCC
>   ENDIF
>   *IF TYPE("tnImportance") != "N"
>    tnImportance = 0 && normal importance
>   *ENDIF
>   .Importance = tnImportance
>   
>  *OlWindowState
>*  olMaximized = 0
>*  olMinimized = 1
>*  olNormalWindow = 2
>
>   IF tlOpenEmail
>     .display()
>     olNormalWindow = 0
>
>     loInspector = .GetInspector()
>     loInspector.WindowState = olNormalWindow
>oWSH = CreateObject( "WScript.Shell" )  &&&& Sergey's suggestion to bring window to forefront
>oWSH.AppActivate( oMailItem.Application.ActiveInspector.Caption )
>     
>   *olMinimized = 1
>   * loInspector = .GetInspector()
>   * loInspector.WindowState = olMinimized
>   ELSE
>
>    .SEND()
>   ENDIF
>  ENDWITH
>
>
>>Try
>>
>>oWSH = CreateObject( "WScript.Shell" )
>>oWSH.AppActivate( oMailItem.Application.ActiveInspector.Caption )
>>
>>
>>>i am running outlook automation - when the email has been prepared and ready to send, i would like the email to appear as the front window - but VFP pops up in front of the email - as a temporary solution i minimize the VFP screen thus:
>>>
>>>_SCREEN.WINDOWSTATE=1
>>>
>>>
>>>in my outlook automation i am using the following code.
>>>
>>>IF tlOpenEmail
>>>     .display() 
>>>     olNormalWindow = 0
>>>
>>>     loInspector = .GetInspector()
>>>     loInspector.WindowState = olNormalWindow
>>>endif
>>>
>>>
>>>what is the line of code i would add to bring the email to the front window?
>>>
>>>thanks for any suggestions.
>>>k
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform