When creating a new document via the code behind like (http://devnet.kentico.com/docs/devguide/index.html?documents_api_examples_creating_documents.htm, second example)
How can I automatically publish the document.
I tried
VersionManager vm = new VersionManager(tree);
vm.PublishVersion(newNode.DocumentCheckedOutVersionHistoryID);
With no success.