Jump to content

تكرار الأمر آليا داخل ماكرو الوورد

Go to solution Solved by محمد طاهر,

Recommended Posts

  • Solution

هذا يتوقف على الامر  هل ينفذ على الكلمة او الحرف او السطر ، فلكل منها طريقة تكرار للتنفيذ

و فى كل الاحوال يتم عمل loop لتكرار التنفيذ او استخدام امر مثل Find لتنفيذ الاستبدال للمجموعة المختارة

بعض الامثلة



For i = 1 To Selection.Words.Count
          With Selection.Words(i)
               If IsNumeric(.Text) Then
                    .Text = "(" & Trim(.Text) & ")"
                     i = i + 1
                End If
          End With
        Next i


    For Each R_o_w In ActiveDocument.Words
        If Len(Selection) = 0 Then R_o_w.Delete Unit:=wdCharacter, Count:=1

استخدام Find

With Selection.Find
        .Text = "^p"
        .Replacement.Text = "، "
End With
    Selection.Find.Execute Replace:=wdReplaceAll


  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...