Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    122
    Thanks
    1
    Thanked 0 Times in 0 Posts

    vba for .rtf file types

    I have some code that I used to loop through documents in a folder and I now want to use the code to loop through another folder containing .rtf files. What do I need to change within the existing code please? Thanks! Violet.

    Code:
     
    Sub updatedisclaimer()
        Const strPath = "C:\Documents and Settings\vanderson1\Desktop\testupdatedisclaimer"
        
        'Loop counter
        Dim i As Integer
        
        'Doc variable
        Dim doc As Document
        
        With Application.FileSearch
            .FileType = msoFileTypeWordDocuments
            .LookIn = strPath
            .Execute
            
            For i = 1 To .FoundFiles.Count
            
            Application.StatusBar = "Processing" & .FoundFiles(i)
            
            Set doc = Documents.Open( _
            FileName:=.FoundFiles(i))
    
            With ActiveDocument
                .Bookmarks("disclaimer").Range.Text = "This is the disclaimer text"
            End With
    
            doc.Close SaveChanges:=True
            
            Next i
            
        End With
        
    End Sub

  2. #2
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    122
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Please ignore!

Posting Permissions

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