Best to get an instance of the current document and store it in it's own object, set the values and save the object. Using the CurrentDocument object is not a good idea. Have you looked at the API documentation for working with Documents/Pages?
Here is an example of the right way to get a document and update a property:
private bool GetAndUpdateDocuments()
{
// Create an instance of the Tree provider first
TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser);
// Fill dataset with documents
DataSet documents = tree.SelectNodes(SiteContext.CurrentSiteName, "/API-Example/%", "en-us", false, "CMS.MenuItem");
if (!DataHelper.DataSourceIsEmpty(documents))
{
// Loop through all documents
foreach (DataRow documentRow in documents.Tables[0].Rows)
{
// Create a new Tree node from the data row
TreeNode editDocument = TreeNode.New("CMS.MenuItem", documentRow, tree);
string newName = editDocument.DocumentName.ToLower();
// Change coupled data
editDocument.SetValue("MenuItemName", newName);
// Change document data
editDocument.DocumentName = newName;
// Save to database
editDocument.Update();
}
return true;
}
return false;
}