- How To Create A Software Program
- How To Create A Simple Business Plan
- Example Simple Program In C++
- How To Write A Simple Program In C++
Use this simple technique to help your userscompose and send email messages
The most popular topic in our advanced AdvancedVisual FoxPro course explains how to send and receive emails automatically fromwithin a VFP application. We show how to do this by using MicrosoftOutlook as an ActiveX Automation server. Although this works very well, thetechnique is somewhat complicated, and you can only use it if the user hasOutlook installed.
- To create an install or setup utility for your Visual FoxPro program, use either a third-party installer or the installer/setup wizard in Microsoft Visual Studio.
- VB 6.0 - HOW TO MAKE FOXPRO TO AN EXECUTABLE PROGRAM? How to make an executable file in Visual Foxpro - Asked By vfp programmer on 21-Nov-05 06:09 AM. To make an executable file in VFP: 1. Click on the main program, the one that you Set to Main 2. EXEFileName Specifies the name of the executable file to create.
In this article, we will describe a muchsimpler approach - one that works with any MAPI-compliant email client (such as Outlook Express). It is not as flexible as theActiveX Automation method, but it has the advantage of requiring only a coupleof lines of code.
The trick is to 'shell execute' amailto link. If you haven't used the ShellExecute() function before, it's worthtaking a moment to get to know it. It is not a VFP function, but is part of theWindows shell. Before you can use it, you must declare it, like so:
You can put this code anywhere in yourapplication, provided it is executed before you create the email message. (Notethat ShellExecute is case-sensitive in the above command.)
So what does it do?
Sep 25, 2012 Remarks Control returns to the Command window when Visual FoxPro is being used interactively. If a distributed run-time application is running, CANCEL terminates the application and control returns to Windows. If a program is executing in Visual FoxPro during design time, CANCEL terminates the program and control returns to the Command window. Get YouTube without the ads. No thanks 3 months free. Find out why Close. Simple program by Foxpro ANIKET HERLE. Unsubscribe from ANIKET HERLE? How to create a 3D Terrain with.
Essentially, ShellExecute() lets you'execute' any pogram, document or shortcut. At its simplest, it can beused to launch an external application. For example, this command will launchNotepad:
Alternatively, you could use the following codeto launch Notepad and have it open a file called Readme.txt:
How To Create A Software Program
And this will launch Word and openDisclaimer.RTF:
The beauty of this is that you don't have toknow which application is registered to open a specific document type on theuser's system. If the user didn't have Word installed, the above code wouldlaunch Wordpad instead, as this can also process RTF files. Of course, if theuser had no application at all associated with RTFs, the command would fail.
The second parameter to ShellExecute() lets youspecify the action that you want to execute. By changing it to'print', for example, you can print the document rather than open itfor editing. Similarly, the following code will play a sound file (using eitherthe Windows Media Player or whatever other application is associated with theWAV extension):
Another possibility:
This will launch the user's default web browserand navigate to the site specified.
For more examples of this versatile function,see our article, Introducing ShellExecute().
What about email?
How To Create A Simple Business Plan
So, back to our original requirement. To createan email message, all you have to do is ShellExecute a mailto link. At itssimplest, the link looks something like this:
So the following code will open a messagecomposing window in the user's default mail client, with the To line alreadyfilled in:
Going further, you can specify the followingparameters to the mailto link:
CC= | Carbon copy |
BCC= | Blind carbon copy |
SUBJECT= | Subject text |
BODY= | Body text |
Place a question mark before the first of theseparameters (right after the email address). Use ampersands to separate furtherparameters, as in this example:
This will produce the message composing windowshown in Figure 1. As you can see, the To, CC and Subject lines are alreadyfilled in, as is the text of the message. All that the user has to do is toclick the Send button.
Figure 1: Use ShellExecute() to pop up thismessage window.
If you want to include a line break in the bodyof the message, insert the new-line character in 'URL format', thatis, as '%0A' (without the quotes). For example:
Limitations
This technique has some obviouslimitation. First, it is not suitable for creating very long messages, as theentire mailto link is subject to a maximum of 2,047 characters. It cannot beused to create formatted messages, nor is it possible to add attachments to themessage. More seriously, you have to rely on the user to actually send themessage. You can't do that programmatically, nor can you prevent the user fromcancelling the message rather than sending it.
On the other hand, if all you need is a simpleway of helping the user to compose and send an unformatted message withoutattachments, the technique will work extremely well. You could use it, forexample, to create a message which confirms an order or one which chases acustomer for payment. It is especially useful if you want to let the user editthe text before hitting the Send button.
Mike Lewis Consultants Ltd. February 2002.Revised April 2005.
More Visual FoxPro articles | Crystal Reports articles | Recommended books | Visual FoxPro consultancy | Contact us
Category | |
---|---|
Category | Developer Tools |
Subcategory | Developer Tutorials |
Thank You for Helping us Maintain CNET's Great Community, !
What's new in version 6 |
---|
This version is the first release on CNET Download.com. |
General | |
---|---|
Publisher | Microsoft |
Publisher web site | http://www.microsoft.com/ |
Release Date | August 22, 2007 |
Date Added | August 22, 2007 |
Version | 6 |
Category | |
---|---|
Category | Developer Tools |
Subcategory | Developer Tutorials |
Operating Systems | |
---|---|
Operating Systems | Windows 95/98/NT/2000/XP |
Additional Requirements | Windows 95/98/NT/2000/XP |
Download Information | |
---|---|
File Size | 87.18KB |
File Name | MenuObject.exe |
Popularity | |
---|---|
Total Downloads | 1,432 |
Downloads Last Week | 1 |
Example Simple Program In C++
Pricing | |
---|---|
License Model | Free |
Limitations | Not available |
Price | Free |