IManDocument doc = 'get some document based on moniker;string id = doc.LatestVersion != null ? doc.LatestVersion.ObjectID : String.Empty;