0

I'm copying a document from one doc library to another library as a New Version. It's working fine and Publishing the copied document in the destination library.

Is there a way to either copy it unpublished, or add a step to unpublish the current copied document?

Vicky
  • 12,934
  • 4
  • 46
  • 54

2 Answers2

0

Try to change "Moderation status" field (_ModerationStatus) of the new document to SPModerationStatusType.Draft

This can help

Andrew Adamich
  • 707
  • 4
  • 8
0

Try Somethinbg like this

Where Source file is your document name

sourceFile.Item.ModerationInformation.Status

set it to draft as sourceFile.Item.ModerationInformation.Status = SPModerationStatusType.Draft

Hope this helps

Sigar Dave
  • 2,598
  • 1
  • 20
  • 42