Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Covert rtf to doc

Posted on 2008-10-17
7
Medium Priority
?
424 Views
Last Modified: 2012-05-05
i was wondering if there is a script that can be built to convert a directory filled with RTF files into word document. Im aware of the file>save as method of converting but our systems spit out RTFs and i was looking for a mass way of converting them all.
0
Comment
Question by:NSNR
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 800 total points
ID: 22740925
It is probably easier to use VBA to create a Word macro, than to use script.

This is in the form of a macro that needs to be called so:

ConfertFromRTF "C:\MyFolder")

Sub ConvertFromRtf(strFolder As String)
    Dim strFileName As String
    Dim Doc As Document
        
    strFileName = Dir$(strFolder & "\*.rtf", vbDirectory)
    Do Until strFileName = ""
        Set Doc = Documents.Open(strFolder & "\" & strFileName, False)
        Doc.SaveAs strFolder & "\" & Replace(strFileName, ".rtf", ".doc"), wdFormatDocument
        Doc.Close
        strFileName = Dir$()
    Loop
End Sub

Open in new window

0
 

Author Comment

by:NSNR
ID: 22741175
how would i use a macro for word?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 22741959
To create the macro, Open Word and toggle to the VBA Editor window with Alt+ F11.

Locate your the Normal template in the left-hand Project pane. Open its contents with the little plus sign. If there is no 'folder' labelled modules, then, from the menu, do Insert/Module. Otherwise expand its contents and select one of the code modules.

Double-click on the new or existing code module to open it. Paste the code into the right-hand code pane.

Run it by clicking in the code to put the cursor in the module and then pressing F5.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:NSNR
ID: 22742879
is there any other way to convert RTF to DOC without using WORD as a medium?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 22744444
You need something that can process both formats. Apart from Word, I understand that OpenOffice can do that, but I haven't seen it and I can't know if it can be automated.

Note that if you want to use VBScript, it will also have to use Word to do the actual conversion.

There might be something that will convert to the 2007 XML format, but it would need the compatibility utility to be readable in Word 2003.
0
 

Author Comment

by:NSNR
ID: 22769075
it doesnt have to be a vbscript.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 22769979
My point is that whatever language you use, it must be able to call upon a resource that knows how to create a Word document, unless, of course, you understand the Word document format and can program it directly.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

719 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