moving/copying attachments from one item to another 
Author Message
 moving/copying attachments from one item to another

Hello All:

Im trying to automate some tasks here, by creating TaskItems from PostItems.

PostItems have attachments that I have to "transfer" to newly created
TaskItems and that is where the problems start ... :)

<Attachments>.Add function requires a file path parameter - it does not
accept objects of Attachment type.  Attachment objects, on the other hand,
have property called FilePath but it seems to get "lost" in the original
object (set to "").

Anyone faced similar problems?

Thanx All,



Sun, 27 Mar 2005 01:50:55 GMT  
 moving/copying attachments from one item to another
The problem is that you can't use:

MyTask.Attachments=MyPost.Attachments.

Why I don't know but that's the way it is.

The solution is to use the FileSystemObject to save the
attachments and then attach them to the new TaskItem and
then delete the files.

HAve a lok here:

http://www.slipstick.com/dev/code/copyatts.htm

Dave

Quote:
>-----Original Message-----
>Hello All:

>Im trying to automate some tasks here, by creating

TaskItems from PostItems.
Quote:

>PostItems have attachments that I have to "transfer" to
newly created
>TaskItems and that is where the problems start ... :)

><Attachments>.Add function requires a file path

parameter - it does not
Quote:
>accept objects of Attachment type.  Attachment objects,
on the other hand,
>have property called FilePath but it seems to get "lost"
in the original
>object (set to "").

>Anyone faced similar problems?

>Thanx All,

>.



Sun, 27 Mar 2005 02:27:33 GMT  
 moving/copying attachments from one item to another
Hi There,

I hope the following code solves ur problem.

For i=1 to myPostItem.Attachments.count
   myPostItem.Attachments.Item
(i).SaveAsFile="C:\kishore\filename"

   myTaskItem.Attachments.Add "C:\kishore\filename"

   Kill "C:\kishore\filename"

Next

Have a nice day.

Rgds,
Kishore

Quote:
>-----Original Message-----
>Hello All:

>Im trying to automate some tasks here, by creating

TaskItems from PostItems.
Quote:

>PostItems have attachments that I have to "transfer" to
newly created
>TaskItems and that is where the problems start ... :)

><Attachments>.Add function requires a file path

parameter - it does not
Quote:
>accept objects of Attachment type.  Attachment objects,
on the other hand,
>have property called FilePath but it seems to get "lost"
in the original
>object (set to "").

>Anyone faced similar problems?

>Thanx All,

>.



Sun, 27 Mar 2005 14:45:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Copying Attachments and Moving messages

2. Moving attachments from one email to another

3. Programmatically copying an attachment from one email to another

4. Copying attachments from one email to another?

5. Method Move - puts copy in delted items.

6. Need help: Rules, Sent property, Move Item.Copy method, VBA fix

7. Extra copy of moved mailitem appears in Deleted Items folder

8. Moving appointment items from one folder to another in Exchange

9. Moving items from one Calender to another

10. move item from one public folder to another

11. Move item from one folder to another?

12. copying macros move one pc to another (word2000)

 

 
Powered by phpBB® Forum Software