We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to place rtf code in Excel Cell and How to convert Excel cell formatted text into Excel

Hi, I am trying to get Excel Cell content which is Formatted i.e rich text, and am getting rtf code of that cell, but how to place that rtf code into Excel cell can u please help me .

That Rtf code am convering to HTML and after ediing that HTML am converting to rtf and i am trying to place that rtf to Excel Cell it is failing it is storing the rtf code not formatted text, can u help in this.

Thanks in advance

Hi,

Thanks for your question.

I am afraid, this feature is not supported. Will you please provide me xlsx file with your RTF code inside it and the actual output you are expecting. We will see if it could be implemented.

hi this is Excel



i converted this to rtf code as like this

{\rtf1\ansi \ansicpg1252
{\fonttbl{\f0\fnil Arial;}{\f1\fnil Arial;}{\f2\fnil Arial;}{\f3\fnil Arial;}{\f4\fnil Arial;}{\f5\fnil Arial;}{\f6\fnil Arial;}{\f7\fnil Arial;}{\f8\fnil Arial;}{\f9\fnil Times New Roman;}{\f10\fnil Times New Roman;}{\f11\fnil Arial;}{\f12\fnil Calibri;}{\f13\fnil Calibri;}{\f14\fnil Calibri;}{\f15\fnil Calibri;}{\f16\fnil Calibri;}{\f17\fnil Calibri;}{\f18\fnil Calibri;}{\f19\fnil Calibri;}{\f20\fnil Calibri;}{\f21\fnil Calibri;}{\f22\fnil Calibri;}{\f23\fnil Calibri;}{\f24\fnil Calibri;}{\f25\fnil Calibri;}{\f26\fnil Cambria;}{\f27\fnil Calibri;}{\f28\fnil Calibri;}{\f29\fnil Arial;}{\f30\fnil Arial;}}
{\info{\id220}}\plain {\colortbl\red0\green0\blue0;\red255\green255\blue255;\red255\green0\blue0;\red0\green255\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red0\green255\blue255;\red0\green0\blue0;\red255\green255\blue255;\red255\green0\blue0;\red0\green255\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red0\green255\blue255;\red128\green0\blue0;\red0\green128\blue0;\red0\green0\blue128;\red128\green128\blue0;\red128\green0\blue128;\red0\green128\blue128;\red192\green192\blue192;\red128\green128\blue128;\red153\green153\blue255;\red153\green51\blue102;\red255\green255\blue204;\red204\green255\blue255;\red102\green0\blue102;\red255\green128\blue128;\red0\green102\blue204;\red204\green204\blue255;\red0\green0\blue128;\red255\green0\blue255;\red255\green255\blue0;\red0\green255\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green128\blue128;\red0\green0\blue255;\red0\green204\blue255;\red204\green255\blue255;\red204\green255\blue204;\red255\green255\blue153;\red153\green204\blue255;\red255\green153\blue204;\red204\green153\blue255;\red255\green204\blue153;\red51\green102\blue255;\red51\green204\blue204;\red153\green204\blue0;\red255\green204\blue0;\red255\green153\blue0;\red255\green102\blue0;\red102\green102\blue153;\red150\green150\blue150;\red0\green51\blue102;\red51\green153\blue102;\red0\green51\blue0;\red51\green51\blue0;\red153\green51\blue0;\red153\green51\blue102;\red51\green51\blue153;\red51\green51\blue51;;\red255\green255\blue255;\red0\green0\blue0;\red236\green233\blue216;\red0\green0\blue0;\red255\green255\blue255;\red172\green168\blue153;\red49\green106\blue197;\red0\green0\blue0;\red212\green208\blue200;\red43\green47\blue55;\red255\green255\blue255;\red0\green0\blue0;\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue0;\red255\green255\blue225;\red0\green0\blue0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\red192\green192\blue192;\red150\green150\blue150;\red128\green128\blue128;\red102\green102\blue102;\red51\green51\blue51;\red0\green0\blue255;\red0\green128\blue0;\red153\green0\blue204;\red128\green0\blue0;\red0\green204\blue51;\red255\green102\blue0;\red204\green0\blue153;\red51\green102\blue153;\red128\green0\blue0;\red0\green128\blue0;\red0\green0\blue128;\red128\green128\blue0;\red128\green0\blue128;\red0\green128\blue128;\red0\green0\blue208;}
\trowd \trgaph30\trleft-30\trrh247\cellx980\pard \intbl \ql \f30\fs20 \b \cf10 Bhupal\cell \pard \intbl \row
\trowd \trgaph30\trleft-30\trrh247\cellx980\pard \intbl \ql \f29\fs20 \i \b0 \cf Shetty\cell \pard \intbl \row
\trowd \trgaph30\trleft-30\trrh1236\cellx980\pard \intbl \ql \f5\fs20 \i0 \b 1. Abc\par 2. Def\par 3. Ghi\par 4. Jkl\par \cell \pard \intbl \row}


and this will be change to HTML and i will edit that html for new format like chnaging color font
and i reconvert that html to rtf and i am trying to reassign that to Excel cell but i failed

Now i want to assign this to cell s

for that can u help me

or tell me how to convert that formatted text from Excel cell to html and html to Excel cell

Bhupal

Hi Bhupal,


I am not sure how Excel will parse rtf to give the formatted data output, if you know, give us example Excel file to do that.

I think for your need, you might use Cell.HtmlString property to get/set HtmlTags to format the cells in the worksheet.

Thank you.