Consulting

Results 1 to 2 of 2

Thread: convert symbol to continuous numbers

  1. #1

    Question convert symbol to continuous numbers

    Hi all,

    i'm looking for a sample way in VBA to look for a symbol through all word files and replace it to continuous numbers

    for ex:

    look for all () symbol at the end of following paragraphs and replace it with number (1,2,3....etc)

    Find:
    also of Virginia. We were extremely lucky


    was sure they wanted to capture Powell.


    It was a pleasant feeling. My body became extremely heavy

    Replace:
    also of Virginia. We were extremely lucky 1


    was sure they wanted to capture Powell. 2


    It was a pleasant feeling. My body became extremely heavy 3




    thanks a lot in advance

  2. #2
    i give my shot and solved it, thx anyway


    Const S_FIND AsString="↑"
    Dim myNumber AsInteger

    myNumber
    =1

    DoWhile InStr(ActiveDocument.Content, S_FIND)>0
    With ActiveDocument.Content.Find
    .ClearFormatting
    .Text = S_FIND
    .Execute Replace:=wdReplaceOne, ReplaceWith:="("& myNumber &")", _
    Forward
    :=True
    EndWith
    myNumber
    = myNumber +1Loop

Tags for this Thread

Posting Permissions

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