×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

Ask for C# help:-- delete empty line in doc file. please look details

Hi Friend:

In my C# Windows Application. I met a problem:

I have create a template doc file. int this file I need replace some strings like, CustomerFirstName, CustomerLastName.CustomerDivision, CompanyName, etc.

the format in doc like:

CustomerFristName CustomerLastname
CustomerDivision
Companyname

I can open this doc file and replace these string no prblem. but sometime some field is empty, for example, CustomerDivision is emply, I dno't want to keep a empty line in doc file and I want to delete this empty line from doc file. I don't know how to do it.

Thanks.
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / Ask for C# help:-- I need to replace string in Word Doc file in my c# application. I did this one. but I want to delete this line from Doc file if this string is null. I don't know how to delete this line from Doc.Thank you very much!
    • need more detail....
      • Ask for C# help:-- delete empty line in doc file. please look details
        Hi Friend:

        In my C# Windows Application. I met a problem:

        I have create a template doc file. int this file I need replace some strings like, CustomerFirstName, CustomerLastName.CustomerDivision, CompanyName, etc.

        the format in doc like:

        CustomerFristName CustomerLastname
        CustomerDivision
        Companyname

        I can open this doc file and replace these string no prblem. but sometime some field is empty, for example, CustomerDivision is emply, I dno't want to keep a empty line in doc file and I want to delete this empty line from doc file. I don't know how to do it.

        Thanks.