• Hi,
    I have some RTFs that were encoded erroneous, presenting wrong cell size of a table.
    If I load them to WPTools and simply change the size of the table and then back, it fixes the encoding of RTF. See:

    Before:

    Code
    {\rtf1\ansi\deff0\uc1\ansicpg1252\deftab300{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset1 Times New Roman;}{\f2\fnil\fcharset2 Wingdings;}{\f3\fnil\fcharset2 Symbol;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red128\green128\blue0;}\wpprheadfoot1\paperw11906\paperh16838\margl760\margr1880\margt760\margb760\headery254\footery254\pgbrdrhead\pgbrdrfoot\pgbrdropt32\endnhere\sectdefaultcl{\*\generator WPTools_6.250;}{\info{\*\operator CBMM}}{\stylesheet{\s1\li0\fi0\ri0\sb0\sa200\sl276\slmult1\ql\vertalt\f0\fs22 Normal;}{\s2\li0\fi0\ri0\sb0\sa0\ql\vertalt\fs22 Default Paragraph Font;}{\s3\li0\fi0\ri0\sb0\sa0\ql\vertalt\f0\fs22\cf11\b EstiloDeEmail15;}}{\tblstart1{\trowd\trleft0\trftsWidth3\trwWidth9053\clbrdrr\brdrs\brdrw15\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clshdnil\clftsWidth1\clvertalt\cellx720\pard\intbl\li0\fi0\ri0\sb0\sa0\ql\clshdnil\plain\fs20\cf15\b Solicita\'E7\'E3o de Mudan\'E7a\cf15\b0 :\cell\row}{\trowd\trleft0\trftsWidth3\trwWidth9053\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clshdnil\clftsWidth1\clvertalt\cellx720\pard\intbl\li0\fi0\ri0\sb0\sa0\ql\clshdnil\pard\intbl\plain\bgbnil\plain\f1\fs20\cf15\line\f1\cf15 Disponiblizar novos tipos de movimento para envio para o Porto em caso de sinistro ou troca de dep\'F3sito no porto.\par\bgbnil\plain\f1\fs20\cf15\line\cell\row}\tblend1\pard\plain\plain\f1\fs20\par\pard\plain\plain\fs20\par}}

    After:

    Code
    {\rtf1\ansi\deff0\uc1\ansicpg1252\deftab300{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset1 Times New Roman;}{\f2\fnil\fcharset2 Wingdings;}{\f3\fnil\fcharset2 Symbol;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red128\green128\blue0;}\wpprheadfoot1\paperw11906\paperh16838\margl760\margr1880\margt760\margb760\headery254\footery254\pgbrdrhead\pgbrdrfoot\pgbrdropt32\endnhere\sectdefaultcl{\*\generator WPTools_6.250;}{\info{\*\operator CBMM}
    }{\stylesheet
    {\s1\li0\fi0\ri0\sb0\sa200\sl276\slmult1\ql\vertalt\f0\fs22 Normal;}
    {\s2\li0\fi0\ri0\sb0\sa0\ql\vertalt\fs22 Default Paragraph Font;}
    {\s3\li0\fi0\ri0\sb0\sa0\ql\vertalt\f0\fs22\cf11\b EstiloDeEmail15;}}
    {\tblstart1{\trowd\trleft0\trftsWidth3\trwWidth9053\clbrdrr\brdrs\brdrw15\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clshdnil\clftsWidth3\clwWidth9053\clvertalt\cellx9053\pard\intbl\li0\fi0\ri0\sb0\sa0\ql\clshdnil\plain\fs20\cf15\b Solicita\'E7\'E3o de Mudan\'E7a\cf15\b0 :\cell\row}{\trowd\trleft0\trftsWidth3\trwWidth9053\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clshdnil\clftsWidth3\clwWidth9053\clvertalt\cellx9053\pard\intbl\li0\fi0\ri0\sb0\sa0\ql\clshdnil\pard\intbl\plain\bgbnil\plain\f1\fs20\cf15\line\f1\cf15 Disponiblizar novos tipos de movimento para envio para o Porto em caso de sinistro ou troca de dep\'F3sito no porto.\par
    \bgbnil\plain\f1\fs20\cf15\line
    \cell\row}\tblend1\pard\plain\plain\f1\fs20\par
    \pard\plain\plain\fs20\par
    }}

    Is there a way to do this programmatically?

    • Offizieller Beitrag

    Please try TableFixAllCellWidths

    This procedure makes sure all tables in the text use fixed widths for their columns.

    If certain columns are defined by contents or by percent values the width which is currently displayed will be used a fixed width. Also see TableAdjustCellWidth.

    Optionally you can provide a 'snap' value in twips, this is value will be used to round each width.