# GrapeCity.Documents.Word.Password.SetPassword

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Word_Password_SetPassword_" data-uid="GrapeCity.Documents.Word.Password.SetPassword*">SetPassword Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Word_Password_SetPassword_" data-uid="GrapeCity.Documents.Word.Password.SetPassword*"></a>
<h4 id="GrapeCity_Documents_Word_Password_SetPassword_System_String_GrapeCity_Documents_Word_CryptographicAlgorithmSid_System_Int32_" data-uid="GrapeCity.Documents.Word.Password.SetPassword(System.String,GrapeCity.Documents.Word.CryptographicAlgorithmSid,System.Int32)">SetPassword(string, CryptographicAlgorithmSid, int)</h4>
<div class="markdown level1 summary"><p>Sets the current password. If password is null or empty, password will be reset.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SetPassword(string password, CryptographicAlgorithmSid sid = CryptographicAlgorithmSid.SHA_512, int spinCount = 50000)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub SetPassword(password As String, Optional sid As CryptographicAlgorithmSid = CryptographicAlgorithmSid.SHA_512, Optional spinCount As Integer = 50000)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">password</span></td>
      <td><p>The password string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Word.CryptographicAlgorithmSid.html">CryptographicAlgorithmSid</a></td>
      <td><span class="parametername">sid</span></td>
      <td><p>The password hashing algorithm.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">spinCount</span></td>
      <td><p>The count of hash transformations used in password generation.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
