Copy cell of Excel with format


#1

Hi,

I want to preserve the format of the text copied from an excel and paste it to a Application(e.g. Notepad).

Text is:

REFERENCE PR/SC NO.:
12345678

USAGE:
XYZ Plant

DELIVERY LEAD TIME:
Approximately 7 days upon receipt of purchase order

DELIVERY ADDRESS:
ABC

NOTE:
Please send your confirmation notice immediately to (abc.xyz@cba.com).
For your strict compliance.

Can anyone please help me with this?


#2

@shivangi_mishra, :Guess:
Reading the cell value from excel wont create an impact on text format (Alignment).

Regards,
Dominic :slight_smile:


#3

It’s not working :confused:


#4

@shivangi_mishra, How do you get the output ?

Regards,
Dominic :slight_smile:


#5

I have tried both Read Cell and and getting the output in Data table by read Range then writing it to text file. When I write it to Output it is giving me the correct format but when I tried by even splitting the text…there is no new line Surprisingly


#6

Hi @shivangi_mishra,

Send your xaml file and input file
Your expected out put file


#7

I solved this… solution below

char[] te = New Char() {"a"c, "b"c}
te(0) = CChar(vbLf)
te(1) = CChar(vbCr)
string[] splittext = outDT.Rows(0)(15).ToString.Split(te, StringSplitOptions.None)
foreach(item in splittext )
{
"In Type Into"
item + Environment.NewLine
}