Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine if an email program is installed?
Message
De
13/02/2003 04:42:38
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00752609
Message ID:
00752613
Vues:
11
>How can i envoke the compose program for a new message from within a Fox app.

I think would use outlook automation to create the message in outlook then the Display Property to show it on screen ready for editing.

As for your detecting mail client problem I use the following but it only checks for outlook.
If you are using MAPI then you should check for that
thisform.outlookautomation=checkserver('outlook.application')


* CheckServer.PRG
* Published in _Microsoft Office Automation with Visual FoxPro_,
* Hentzenwerke Publishing, June, 2000.
* www.hentzenwerke.com
* lWordExists = CheckServer("Word.Application")
* Copyright 2000 by Tamar E. Granor and Della Martin All Rights Reserved
LPARAMETER cServerName
if vartype(cServerName)<>"C"
   cServerName = "Word.Application" && Default check for Word
endif   
LOCAL oRegistry, cClassID, cEXEName, lEXEExists, ;
      aClassIDValues, aClassIDValues, aServerNameValues

IF VERSION() >= "Visual FoxPro 06"
	oRegistry = NewObject("Registry")
  * oRegistry = NewObject("Registry", HOME() + "FFC\Registry")
ELSE
  SET PROCEDURE TO HOME() + "samples\classes\registry.prg" ADDITIVE
  oRegistry = CreateObject("Registry")
ENDIF

lEXEExists = .F.

DECLARE aClassIDValues[1], aServerNameValues[1]

WITH oRegistry
  * Find the CLSID of the server. First, look for
  * the Class's Key.
  IF .OpenKey(cServerName + "\CLSID") = 0
    * The Class's Key is open, now enumerate its values
    .EnumKeyValues(@aClassIDValues)

    * The data portion of the first (only) value returned
    * is the CLSID. Find the LocalServer32 key for the CLSID 
    IF .OpenKey("CLSID\" + aClassIDValues[1,2] + "\LocalServer32") = 0
      * Enumerate the LocalServer32 values
      .EnumKeyValues(@aServerNameValues)

      * The EXE file is stored in the first (only) data value returned. 
      cEXEName = aServerNameValues[2]

      * The value that's returned may have " -Automation" or " /Automation" or
      * " /AUTOMATION" & other trailing stuff at the end. Strip it off.
      IF "AUTO" $ UPPER(cEXEName)
        cEXEName = LEFT(cEXEName, ATC("AUTO", UPPER(cEXEName)) - 2)
      ENDIF

      * Verify that the file exists 
      lEXEExists = FILE(cEXEName) 
    ENDIF 
  ENDIF
ENDWITH

RETURN lEXEExists
>I have 2 questions?
>
>1)
>
>How can I determine from Fox app that a user has an email clinet such as outlook or outlook express installed?
>
>2)
>
>How can i envoke the compose program for a new message from within a Fox app.
>
>Regards,
>
>Stuart
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform