• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Bul ve Değiştir'i tüm alt klasörlere nasıl uygulayabilirim?

Katılım
30 Eylül 2012
Mesajlar
45
Excel Vers. ve Dili
2012
Word makroda elimde şöyle bir kod var

Kod:
Sub Test()

'// Word dokumanında degisiklik yapmak zetoda //


Dim MyPath As String, MyFile As String
Dim No As Integer, x As Integer, i As Integer
Dim Msg1 As String, Msg2 As String
Application.ScreenUpdating = False
MyPath = ThisDocument.Path
MyFile = Dir(MyPath & Application.PathSeparator & "*.doc", vbDirectory)
Do While MyFile <> ""
If MyFile <> ThisDocument.Name Then
No = No + 1
Documents.Open MyPath & Application.PathSeparator & MyFile
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[B]Amerika[/B]"
.Replacement.Text = "[B]Afrika[/B]"
.Forward = True
.Wrap = wdFindContinue
.MatchCase = False
If .Execute Then x = x + 1
.Execute Replace:=wdReplaceAll
End With
End If
MyFile = Dir
Loop
For i = Documents.Count To 1 Step -1
If Documents(i).Name <> ThisDocument.Name Then
Documents(i).Close SaveChanges:=True
End If
Next
Application.ScreenUpdating = True
Msg1 = " Kontrol edilen dosya sayısı = " & No
Msg2 = x & " adet dosyada degistirme yapildi."
MsgBox Msg1 & vbCrLf & Msg2, vbInformation, "Rapor !"
End Sub


yukardaki kod sisteminde yer alan, "Amerika" kelimesini "Afrika" ile değiştirmek istiyorum. Ancak bunu tüm alt klasörlere de uygulansın istiyorum.

Şimdiden yardımlarınız için teşekkürler. :)
 
Geri
Üst