<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Fit table cell text in one line in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9712673#M4253</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I cannot answer directly to your question but could be used a method to fix the cell width based upon bounding text box dimensions.&lt;/P&gt;&lt;P&gt;I know it's an empiric method but in my opinion should work.&lt;/P&gt;&lt;P&gt;You should make a scan of all text content, calculating the width based upon bounding box, and fix the column width with max value result, before populating the cell, and fix manually the column width.&lt;/P&gt;&lt;P&gt;I don't know what's happen if the cell it's linked for example with and excel file where the option of text wrap it's disabled.&lt;/P&gt;&lt;P&gt;I'm trying to investigate, or may be some forum expert could help you more before.&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;</description>
    <pubDate>Wed, 26 Aug 2020 11:52:37 GMT</pubDate>
    <dc:creator>grobnik</dc:creator>
    <dc:date>2020-08-26T11:52:37Z</dc:date>
    <item>
      <title>Fit table cell text in one line</title>
      <link>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9712306#M4252</link>
      <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the title suggests, I need help to fit the text cells of an AutoCad table in one line. I've read through Autodesk documentation and I find it a nightmare, I'm just going round in circles. I've looked up the two following options to no avail (SetAutoScale and SetAutoScale2). The first one is self-explanatory whereas the second one is unclear as far the nContent parameter (what is it exactly? It's a Long so being the actual content of the cell would make no sense).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both methods may not be what I'm after, but do you have any ideas? I've also tried to use Stretch but it's not available in VBA Autocad to my surprise (maybe it's been named differently in VBA?). I want to fit all of the cells in the table but would it be possible apply it to cells in the data range, for instance, and not those in the headers?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="body_content"&gt;&lt;DIV class="bodyReference"&gt;&lt;DIV class="section"&gt;&lt;DIV class="codeBlock"&gt;&lt;PRE&gt;object.SetAutoScale &lt;EM&gt;row, col, bValue&lt;/EM&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="body_content"&gt;&lt;DIV class="bodyReference"&gt;&lt;DIV class="section"&gt;&lt;DIV class="codeBlock"&gt;&lt;PRE&gt;object.SetAutoScale2 &lt;EM&gt;nRow, nCol, nContent, bAutoFit&lt;/EM&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:31:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9712306#M4252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-26T08:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fit table cell text in one line</title>
      <link>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9712673#M4253</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I cannot answer directly to your question but could be used a method to fix the cell width based upon bounding text box dimensions.&lt;/P&gt;&lt;P&gt;I know it's an empiric method but in my opinion should work.&lt;/P&gt;&lt;P&gt;You should make a scan of all text content, calculating the width based upon bounding box, and fix the column width with max value result, before populating the cell, and fix manually the column width.&lt;/P&gt;&lt;P&gt;I don't know what's happen if the cell it's linked for example with and excel file where the option of text wrap it's disabled.&lt;/P&gt;&lt;P&gt;I'm trying to investigate, or may be some forum expert could help you more before.&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 11:52:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9712673#M4253</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2020-08-26T11:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Fit table cell text in one line</title>
      <link>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9713525#M4254</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;, &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1706559"&gt;@ambrosl&lt;/a&gt;&amp;nbsp;it was a long time ago 2018, and I had the same issue, see my post&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/vba/table-setautoscale-amp-setautoscale2/td-p/7715509" target="_blank"&gt;https://forums.autodesk.com/t5/vba/table-setautoscale-amp-setautoscale2/td-p/7715509&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and the answer of an expert &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1706559"&gt;@ambrosl&lt;/a&gt;&amp;nbsp;was the same of that I gave you to calculate the width of longest text and fix later the width.&lt;/P&gt;&lt;P&gt;See also the code attached to that post, could help you.&lt;/P&gt;&lt;P&gt;I tried also with a simple table in a drawing and the effect was the same the column width still remain the same and does not fit to the text plus setting cell margin.&lt;/P&gt;&lt;P&gt;Probably something has been updated since 2018 to now, but I'm missing something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bye&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 18:27:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9713525#M4254</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2020-08-26T18:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Fit table cell text in one line</title>
      <link>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9714406#M4255</link>
      <description>&lt;P&gt;Good morning grobnik,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your reply and the time you have put into it, the whole situation was driving me nuts. I'm glad that I asked you because I can see we went through the same struggles. I'm also glad that the AutoDesk expert admitted that the documentation needs improving as it's completely unclear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm going to accept your answer as it doesn't seem to be any other solution for the time being.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 07:17:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/fit-table-cell-text-in-one-line/m-p/9714406#M4255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-27T07:17:42Z</dc:date>
    </item>
  </channel>
</rss>

