none
How to replace Soft Return symbols with Paragraph symbol in word document RRS feed

  • Question

  • Hi All,

    I have a high Priority task. Please help me

    can any one tell me c# code for replace all soft returns with paragraph marker in word document. I ran macro but was not help me

    Thanks in Advance

    Lakshmi Prasad

    Friday, June 15, 2012 9:08 AM

Answers

  • Hi Lakshmi,

    This is not C# code but VBA and do what you want. I think you will have no problems rewriting it in C#:

        Set oRng = ActiveDocument.Range
       
        With oRng.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "^l"
            .Replacement.Text = "^p"
            .Forward = True
            .Wrap = wdFindContinue
            .Execute Replace:=wdReplaceAll
        End With

    Regards,
    Lars-Eric

    Friday, June 15, 2012 9:46 AM

All replies

  • Hi Lakshmi,

    This is not C# code but VBA and do what you want. I think you will have no problems rewriting it in C#:

        Set oRng = ActiveDocument.Range
       
        With oRng.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "^l"
            .Replacement.Text = "^p"
            .Forward = True
            .Wrap = wdFindContinue
            .Execute Replace:=wdReplaceAll
        End With

    Regards,
    Lars-Eric

    Friday, June 15, 2012 9:46 AM
  • Thank you verymuch works perfectly...
    Friday, June 15, 2012 12:20 PM