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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pasting a file to a folder

Status
Not open for further replies.

AlanArons

Programmer
Aug 1, 2002
91
US
Hi All,

My goal is to paste a file copied to the clipboard(e.g. an Outlook attachment) to an existing folder without opening the folder in VFP 6.0.

Any thoughts on this.

Alan Arons [ponder]
 
Unfortunately an Outlook attachment is not a discrete file from the OS perspective. Instead it is contained as part of Outlook's overall PST file.

Copying a separate file would be a trivial task, but not having a discretely separate file makes it difficult to do a Save As... or Copy of the attachment file to another location.

You might want to look deeper into doing Automation of Outlook in your VFP application to see if this might be done using it.

Good Luck,
JRB-Bldr
 
Even though it is part of the .pst, we can still copy it (CTRL+C) to the Windows clipboard.

If I copied a file from another folder, could I paste that to a different folder?

Alan Arons [ponder]
 
Within Outlook you can Open the Attachment and then, from there, you can Save the Attachment to a non-PST location.

I am not clear on what you mean by "If I copied a file from another folder, could I paste that to a different folder?"
Which a file from another folder?
The Attachment?

If the Attachment is already saved in another non-PST folder then you can merely use VFP's COPY FILE command to copy it elsewhere.

Good Luck,
JRB-Bldr


 
Thanks for your input.

If I open an Outlook Email with attachments, I can select an attachment, press <ctrl+c>, go a folder and paste the attachment <ctrl+v> to the folder. It is not necessary to open the file.

My goal, is to open the email, select the attachment, and press <ctrl+c>. I then want to go to my vFox application and click a button that will paste the file to a folder without opening the folder.

I am also open to other methods besides copy / paste. Any input is appreciated.

Alan Arons [ponder]
 
In your "open email, ctrl-c, go to folder and paste" scenario you are using two applications. You're using Outlook to get a file reference onto the clipoard and Windows Explorer to do the paste operation.

Both of those applications can be automated in code. What have you tried so far? What hasn't worked?

 
I recall you do this with so called shell API commands.
I have an application doing something like this

oOutlook = Createobject("Outlook.Application")
oNameSpace = oOutlook.GetNameSpace("MAPI")
oMailItem = oOutlook.CreateItem( 0 )
With oMailItem
.Subject = subj
.Body = subj
.Body = .Body + Chr(13) + "This message was automation-created with Clausius!"
.Recipients.Add(email)
LastRecipient = .Recipients.Add(afzemail)
LastRecipient.Type = 2 && Carbon Copy
.Attachments.Add(Fullpath(ml))
.Send()
Endwith

For your task you have to look up outlook's other .commands
 
The answer to my issues came with the use of the Vfox Web Browser Class. Internet Explorer and Windows Explorer as it turns out operate the same. If you use the full path as the address it is exactly what I wanted.

The only issue I have yet to overcome is how to control the "View" (Thumbnail, Tile, Icon, List Detail) in XP. The system does not retain the setting and always is displayed in the Icon view when the Detail view is preferred.

Any insight on this would be appreciated.

Alan Arons [ponder]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top