×

Loading...
Ad by
  • 予人玫瑰,手有余香:加拿大新天地工作移民诚聘求职顾问&行业导师!
Ad by
  • 予人玫瑰,手有余香:加拿大新天地工作移民诚聘求职顾问&行业导师!

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.