Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any way to know if user has Outlook profile?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Any way to know if user has Outlook profile?
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01007513
Message ID:
01007513
Views:
65
We've added an email routine to our reports so that the user can easily email the report instead of prining it. Our idea was, try to use Outlook first and if that doesn't work for some reason, we'll pop open our own form that allows them to enter the email address, subject, etc.

However, if a user does not use Outlook and has never set up a profile, etc. we definitely don't want Outlook to open and start prompting the user to set all that stuff up. My code looks like this:
LPARAMETERS cFileName, lNoOutlook

llOutlook = EMPTY(lNoOutlook)
llSent = .F.
loApp = .NULL.
loItem = .NULL.

...

*--- If program allows Outlook to be used, try to use it
IF !lNoOutlook
   TRY 
      loApp = CREATEOBJECT("Outlook.Application")
      loItem = loApp.CreateItem(0)
   CATCH
      RELEASE loApp
      RELEASE loItem
   ENDTRY
ENDIF 

*--- If Outlook was properly instantiated
IF VARTYPE(loApp) == 'O' AND VARTYPE(loItem) == 'O'
   TRY 
      loItem.Attachments.Add(cFileName)
      loItem.Subject = oPrt.EmailSubject
      loItem.Display
      llSent = .T.
   CATCH 
      llSent = .F.
   ENDTRY 
ELSE
   DO FORM frmEmail WITH cFileName TO llSent
ENDIF

RELEASE loApp
RELEASE loItem

RETURN llSent
How can I determine ahead of time that the user is not using Outlook and skip straight to our form?

Thanks for your help.

Rodd
Next
Reply
Map
View

Click here to load this message in the networking platform