How to insert programmatically a new line in an Excel cell in C#?

后端 未结 13 1136
情话喂你
情话喂你 2020-12-30 00:32

I\'m using the Aspose library to create an Excel document. Somewhere in some cell I need to insert a new line between two parts of the text.

I tried \"\\r\\n\" but i

13条回答
  •  失恋的感觉
    2020-12-30 01:06

    You can use Chr(13). Then just wrap the whole thing in Chr(34). Chr(34) is double quotes.

    • VB.Net Example:
    • TheContactInfo = ""
    • TheContactInfo = Trim(TheEmail) & chr(13)
    • TheContactInfo = TheContactInfo & Trim(ThePhone) & chr(13)
    • TheContactInfo = Chr(34) & TheContactInfo & Chr(34)

提交回复
热议问题