Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Script needed to save a folder full of .Rtf files to .Docx format

    Hello,

    I am trying to find a macro/script that will allow me to:

    1. Point to a folder full of .RTF files.
    2. Save each file to .Docx


    I am using MS Word 2010 Professional on a Windows 7 64 Bit laptop.


    Thanks for any suggestions.

    Regards,

    Jim

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Jim

    You will need a batch conversion script to do this. That sort of question has been asked many times before so you will find several examples on this forum.

    A reasonable place to start would be the thread at http://windowssecrets.com/forums/sho...l=1#post886045
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks Andrew. I ran a search earlier, but I guess I did not have the right keywords. I will check the thread you referenced.

    Thanks,

    Jim

  4. #4
    New Lounger
    Join Date
    Feb 2013
    Location
    Bucharest, Romania
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is a tool than can do it softinterface.com/Convert-Doc/Features/Convert-RTF-To-DOCX.htm

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Try:
    Code:
    Sub UpdateDocumentFormats()
    Application.ScreenUpdating = False
    Dim strFolder As String, strFile As String, wdDoc As Document
    strFolder = GetFolder
    If strFolder = "" Then Exit Sub
    strFile = Dir(strFolder & "\*.rtf", vbNormal)
    While strFile <> ""
      Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False)
      With wdDoc
        .SaveAs2 FileName:=Left(.FullName, InStrRev(.FullName, ".")) & "docx", Fileformat:=wdFormatXMLDocument, AddToRecentFiles:=False
        .Close wdDoNotSaveChanges
      End With
      strFile = Dir()
    Wend
    Set wdDoc = Nothing
    Application.ScreenUpdating = True
    End Sub
    
    Function GetFolder() As String
    Dim oFolder As Object
    GetFolder = ""
    Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
    If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
    Set oFolder = Nothing
    End Function
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi Paul,

    Thanks for the posting and my apologies for the delay in getting back to you - work has been incredibly busy.
    I will give the code out when I get a moment.

    Thanks again for taking the time to post this.

    Jim

  7. #7
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks for the tip Abraham. I will check it out.

    Jim

Posting Permissions

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