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?

2 Answers 2

0

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

This can help

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.