# C1.Word.C1WordDocument.MeasureString

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Word_C1WordDocument_MeasureString_" data-uid="C1.Word.C1WordDocument.MeasureString*">MeasureString Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Word_C1WordDocument_MeasureString_" data-uid="C1.Word.C1WordDocument.MeasureString*"></a>
<h4 id="C1_Word_C1WordDocument_MeasureString_System_String_C1_Util_Font_System_Single_C1_Util_StringFormat_System_Int32_" data-uid="C1.Word.C1WordDocument.MeasureString(System.String,C1.Util.Font,System.Single,C1.Util.StringFormat,System.Int32)">MeasureString(string, Font, float, StringFormat, int)</h4>
<div class="markdown level1 summary"><p>Measure string for this document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static SizeF MeasureString(string text, Font font, float width, StringFormat sf, int firstChar)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function MeasureString(text As String, font As Font, width As Single, sf As StringFormat, firstChar As Integer) As SizeF</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">text</span></td>
      <td><p>The drawing string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.Font.html">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>The drawing font.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The drawing width or -1 for default.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.StringFormat.html">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p>The drawing string format.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">firstChar</span></td>
      <td><p>The zero-based starting character position of a string.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><p>The size, in points, of the string specified as drawn with the font parameter.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Word_C1WordDocument_MeasureString_" data-uid="C1.Word.C1WordDocument.MeasureString*"></a>
<h4 id="C1_Word_C1WordDocument_MeasureString_System_String_C1_Util_Font_" data-uid="C1.Word.C1WordDocument.MeasureString(System.String,C1.Util.Font)">MeasureString(string, Font)</h4>
<div class="markdown level1 summary"><p>Measure string for this document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SizeF MeasureString(string text, Font font)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureString(text As String, font As Font) As SizeF</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">text</span></td>
      <td><p>The drawing string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.Font.html">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>The drawing font.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><p>The size, in points, of the string specified as drawn with the font parameter.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="C1.Util.IFlowDocument.MeasureString.html#C1_Util_IFlowDocument_MeasureString_System_String_C1_Util_Font_">IFlowDocument.MeasureString(string, Font)</a></div>


<a id="C1_Word_C1WordDocument_MeasureString_" data-uid="C1.Word.C1WordDocument.MeasureString*"></a>
<h4 id="C1_Word_C1WordDocument_MeasureString_System_String_C1_Util_Font_System_Single_" data-uid="C1.Word.C1WordDocument.MeasureString(System.String,C1.Util.Font,System.Single)">MeasureString(string, Font, float)</h4>
<div class="markdown level1 summary"><p>Measure string for this document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SizeF MeasureString(string text, Font font, float width)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureString(text As String, font As Font, width As Single) As SizeF</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">text</span></td>
      <td><p>The drawing string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.Font.html">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>The drawing font.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The drawing width or -1 for default.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><p>The size, in points, of the string specified as drawn with the font parameter.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="C1.Util.IFlowDocument.MeasureString.html#C1_Util_IFlowDocument_MeasureString_System_String_C1_Util_Font_System_Single_">IFlowDocument.MeasureString(string, Font, float)</a></div>


<a id="C1_Word_C1WordDocument_MeasureString_" data-uid="C1.Word.C1WordDocument.MeasureString*"></a>
<h4 id="C1_Word_C1WordDocument_MeasureString_System_String_C1_Util_Font_System_Single_C1_Util_StringFormat_" data-uid="C1.Word.C1WordDocument.MeasureString(System.String,C1.Util.Font,System.Single,C1.Util.StringFormat)">MeasureString(string, Font, float, StringFormat)</h4>
<div class="markdown level1 summary"><p>Measure string for this document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SizeF MeasureString(string text, Font font, float width, StringFormat sf)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureString(text As String, font As Font, width As Single, sf As StringFormat) As SizeF</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">text</span></td>
      <td><p>The drawing string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.Font.html">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>The drawing font.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The drawing width or -1 for default.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.StringFormat.html">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p>The drawing string format.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><p>The size, in points, of the string specified as drawn with the font parameter.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="C1.Util.IFlowDocument.MeasureString.html#C1_Util_IFlowDocument_MeasureString_System_String_C1_Util_Font_System_Single_C1_Util_StringFormat_">IFlowDocument.MeasureString(string, Font, float, StringFormat)</a></div>
</div>
