+ Reply to Thread
Results 1 to 5 of 5

Delete all lines in word document

  1. #1
    jesika
    Guest

    Delete all lines in word document

    Hi,

    How can I delete all lines in my word document which begin from some word
    Like "2 NICK".just send me your suggestions.

    Thanks

  2. #2
    J.wills
    Guest

    Re: Delete all lines in word document

    Hi jes,

    If they are paragraphs then use this particular code:

    Selection.HomeKey wdStory
    Selection.Find.ClearFormatting
    With Selection.Find
    Do While .Execute(FindText:="^p2 NICK", Forward:=True, _
    MatchWildcards:=False, Wrap:=wdFindContinue, MatchCase:=True) = True
    Selection.Paragraphs(2).Range.Delete
    Loop
    End With

    Try this code this may help u...

  3. #3
    jesika
    Guest

    Re: Delete all lines in word document

    Hi,

    Thanks Wills for your suggestions ,i've tried this code but it did't show me the appropriate result......i've used this code but no deletion is performed.when i run this code it shows error on this line

    MatchWildcards:=False, Wrap:=wdFindContinue, MatchCase:=True) = True.

    Kindly help.....

    Thanks
    jesika

  4. #4
    J.wills
    Guest

    Re: Delete all lines in word document

    Just check have to done this like true

    Do While Execute(FindText:="^p2 NICK", Forward:=True, _

    MatchWildcards:=False, Wrap:=wdFindContinue, MatchCase:=True) = True
    Selection.Paragraphs(2).Range.Delete

    check the range you have given.....

  5. #5
    jesika
    Guest

    Re: Delete all lines in word document

    ya that line is true but i m facing problem in range......

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1