How do i convert .rtf Into .doc

Posted on 2007-08-11
Last Modified: 2013-11-05
Hi i need to convert some .rtf files to .doc is there a free way to do if not whats my options i'm using word 2003
Question by:eric55
    LVL 58

    Accepted Solution

    You can open the *.rtf, and use (File | Save As...) to save as *.doc.

    LVL 15

    Expert Comment

    You can just rename the files (a.rtf -> a.doc). Why?

    Author Comment

    what i tried so far is in properties i changed the open with from word pad to word and it didnt work i'll try changing the extention i;ll let you know thanks
    LVL 19

    Expert Comment

    file  - save as - word document .doc

    or programatically
    found here

    save this as a vbs file

    '' Start of Script
    Option Explicit
    On Error Resume Next
    Dim Response
    Dim anRTForDOCisOpen_Flag
    dim nominatedFolder
    dim fso
    dim oApp
    set oApp = createobject("Word.Application")
    Set fso = CreateObject("Scripting.FileSystemObject")

    nominatedFolder =fso.GetAbsolutePathName ("convertRTF2DOC.vbs")

    nominatedFolder = Left(nominatedFolder, _
    Response = MsgBox("Instruction:" & vbCrLf & _
    "Place a copy of this program in any folder that" & _
    " contains .rtf files that you want to convert to .doc files." _
    & vbCrLf & _
    "Please CLOSE all .rtf files to be converted to .doc files." _
    & " And CLOSE all related .doc file with similar name as the .rtf. " _
    & vbCrLf & "Double click on the program to start it and get this" & _
    "initial window message prompt." & vbCrLf & vbCrLf & _
    "Note:"&vbCrLf & _
    "This program will completely replace the RTF files with DOC files." _
    & vbCrLf & vbCrLf & "This program's current folder is " _
    & nominatedFolder _
    & vbCrLf & vbCrLf & vbCrLf & _
    "Press OK button to continue with the conversion.", vbOKCancel, _
    "RTF to DOC")

    If Response <> 2 Then

    ShowFolderList(nominatedFolder) ' call procedure

    End if
    set oApp = nothing
    Set fso = nothing
    Set nominatedFolder = nothing
    ' End of Script

    '**************sub procedure*******************
    'this sub procedure is copied from Peter Jamieson post
    'Thanks for inspiring me to expand your original script
    sub convertRTFtoDOC(pathWithRTFfilename)
    dim newpathFilename 'as string
    dim oDoc 'as object

    newpathFilename = pathWithRTFfilename
    ' the ,0 parameter means do not confirm conversions
    set oDoc = oApp.Documents.Open(newpathFilename,0)
    'remove .rtf and replace with .doc as the new filename
    newpathFilename = Left(newpathFilename, _
    Len(newpathFilename) - 4) & ".doc"
    ' the 0 parameter means use .doc format
    oDoc.SaveAs newpathFilename, 0
    oDoc.close ' Important to close the .doc file

    End sub

    '************sub procedure********************
    Sub ShowFolderList(folderspec)
    Dim fs, f, f1, fc, s, i
    i = 0
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(folderspec)
    Set fc = f.Files
    'loop & capture RTF & send to another sub for conversion to DOC
    For Each f1 in fc

    verifyIfRTForDOCopen (
    if (anRTForDOCisOpen_Flag = true) then
    exit sub
    end if

    if (f1.type = "Rich Text Format") then

    convertRTFtoDOC f1

    s = s &
    s = s & vbCrLf 'visualbasicCarriageLineFeed
    f1.Delete True ' True force delete of read only file
    i = i + 1 'count how many .rtf files

    end if

    ' release memory use by object - not needed anymore.
    Set fs = nothing
    Set f = nothing
    Set fc = nothing

    If s = "" then
    MsgBox "No .rtf file have been found in the folder " & folderspec & _
    vbCrLf & vbCrLf & "Press OK button to EXIT."
    MsgBox s & vbCrLf & i & " .rtf file converted to .doc file."
    end if
    Set nominatedFolder = nothing
    End Sub

    '*********************sub procedure***********************
    sub verifyIfRTForDOCopen (f1dotname)

    Dim colTasks , objTask, strName1,strName2
    Set colTasks = oApp.Tasks
    anRTForDOCisOpen_Flag = false

    For Each objTask in colTasks

    strName1 = Lcase(objTask.Name)
    strName2 = Lcase(Left(f1dotname,Len(f1dotname) - 4))

    If (Instr(strName1,strName2) >= 1) Then
    MsgBox f1dotname & " is left open. Please close this file. " _
    & vbCrLf & vbCrLf & _
    "This program is halted!!! " & _
    "Close all RTF and related DOC file before restarting program."_
    , 0,"You have forgotten to close a file!!!"

    anRTForDOCisOpen_Flag = true

    exit sub
    End If
    End sub
    LVL 7

    Expert Comment

    Hello ric55,
    Just open the file in MS-Word and then save the file with other name as .doc.
    I think this is pretty simple one.

    And if you have more files then you have to rename the files using batch rename software to one go.
    Hope this helps,
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
    A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
    The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now