Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to move emails to a alternate .pst file and etc.

Status
Not open for further replies.

freddiekg

Programmer
Oct 13, 2009
25
0
0
MY
Dear all,

With all your helps. I can now store all the emails information in the "Archive" folder into DBF using the outlook.application object.

Those archived emails will be deleted or moved to a remote server. My question is is it possible to write a VFP program automatically move those archived email to a different outlook .pst file in the remote server and also delete it from the original "Archive" folder?

If this is possible, then I can programmatically switch the outlook .pst file within the VFP apps when the users want to view the archieved emails just like the originals.

Thanks a lot in advance.

Freddie
 
If the 'archived' email information is in a VFP data table (DBF file) then sure you can copy it or move it wherever you need.

If you are talking about moving the PST files themselves, again, sure you can use the COPY FILE TO command.
BUT the users cannot be in OUTLOOK and using the PST file which is to be moved.

NOR can they be in OUTLOOK when you want to change them to another PST file.

Remember that OUTLOOK is configured to use one or more pre-defined PST files so if you move one you will need to be certain that it will end up with a path & filename that is already defined into the user's OUTLOOK or else it will complain when opened.

Good Luck,
JRB-Bldr
 
Dear JRB-Bldr,

Thanks for your input. I try to do the following tasks and would like your input and help:

(1) Extract outlook emails from the "Archive" folder and store the informtion in a DBF file. (Completed)

(2) Recreate the output, "emails look alike" page from the stored records in DBF. Is working but the only issue is the original 'format' (fonts, special characters and etc.) of the email was lost. (Completed)

(3) In addition to the above, now, I try to see is possible to somehow copy/move the emails in the "Archive" folder to another outlook .PST file in different directory using VFP. I will create sub-folders in this .PST file by the user names, so, the management can access this particular outlook .PST file to view all the archieved emails in the original format, plus I can also generate VFP reports from the information that already stored in the DBF in (1) above.

Please give me some suggesstions of where should I look into to get this done.

Thanks a lot!
Freddie
 
I have already told you to use the COPY FILE TO command.

You need to know 4 things:
1. The path where the original "Archive" PST file is.
2. You know its name
3. The path where you want to put the copy PST file.
4. The name of the copy PST file.

Then its nothing more than

Code:
cSource = ADDBS(cOrigPath) + cOrigName
cDestinaton = ADDBS(cNewPath) + cNewName

COPY FILE (cSource) TO (cDestination)

* --- If you want to eliminate the original ---
IF FILE(cDestination)
   ERASE (cSource)
ENDIF

You could have looked up the COPY FILE TO command in your VFP Help and most likely figured this out for yourself.

As I said before the VFP work is trivial. The challenges you may encounter will come from OUTLOOK. Follow the advice I gave above and see how far your ingenuity can take you.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top