Discussion:
SPListItem.CopyTo
(too old to reply)
zza
2007-05-16 21:03:23 UTC
Permalink
Has anyone successfully used SPListItem.CopyTo() ?

I am trying to use it and it is failing with an error : Cannot find
source object. Any Ideas?
jpd
2007-06-27 18:16:04 UTC
Permalink
I haven't found a resolution to this problem either.

This error doesn't make any sense. I'm copying from the "source" item..so
how can it not be found??
Post by zza
Has anyone successfully used SPListItem.CopyTo() ?
I am trying to use it and it is failing with an error : Cannot find
source object. Any Ideas?
unknown
2010-02-24 09:46:24 UTC
Permalink
Hi,

CopyTo() works for me. You just have to specify not only the destination library but the name of the file like so:

string destinationURL = destinationLibrary.ParentWeb.Site.Url + destinationLibrary.RootFolder.ServerRelativeUrl + "/" + workflowProperties.Item.Name;
workflowProperties.Item.CopyTo(destinationURL);

where destinationLibrary is of type SPDocumentLibrary and workflowProperties.Item is of type SPListItem.

I hope that helps.



jp wrote:

I haven't found a resolution to this problem either.
27-Jun-07

I have not found a resolution to this problem either

This error does not make any sense. I am copying from the "source" item..s
how can it not be found?

"zza" wrote:

Previous Posts In This Thread:

On Wednesday, May 16, 2007 5:03 PM
zza wrote:

SPListItem.CopyTo
Has anyone successfully used SPListItem.CopyTo()

I am trying to use it and it is failing with an error : Cannot fin
source object. Any Ideas?

On Wednesday, June 27, 2007 2:16 PM
jp wrote:

I haven't found a resolution to this problem either.
I have not found a resolution to this problem either

This error does not make any sense. I am copying from the "source" item..s
how can it not be found?

"zza" wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
EggHeadCafe Chat Chaos in Silverlight Released Today
http://www.eggheadcafe.com/tutorials/aspnet/325ea67e-d6c4-4811-b096-54f31bdede5d/eggheadcafe-chat-chaos-in.aspx
Loading...