Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Document Management / March 2008

Tip: Looking for answers? Try searching our database.

How do I convert a file to a rich text file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pat - 12 Mar 2008 14:30 GMT
I have a whole list of word files that need to be converted to rich test
files to download into our EMR system and cannot figure out the best
(easiest) way to do it.
Graham Mayor - 12 Mar 2008 14:41 GMT
The following macro will convert all the doc files in a folder to RTF

Sub SaveAllAsRTF()
Dim strFileName As String
Dim strDocName As String
Dim strPath As String
Dim oDoc As Document
Dim Response As Long
Dim fDialog As FileDialog

Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

With fDialog
   .Title = "Select folder and click OK"
   .AllowMultiSelect = False
   .InitialView = msoFileDialogViewList
   If .Show <> -1 Then
       MsgBox "Cancelled By User", , "Save all as RTF"
       Exit Sub
   End If
   strPath = fDialog.SelectedItems.Item(1)
   If Right(strPath, 1) <> "\" Then strPath = strPath + "\"
End With

If Documents.Count > 0 Then
   Documents.Close SaveChanges:=wdPromptToSaveChanges
End If

strFileName = Dir$(strPath & "*.doc")

While Len(strFileName) <> 0
Set oDoc = Documents.Open(strPath & strFileName)

   strDocName = ActiveDocument.FullName
   intPos = InStrRev(strDocName, ".")
   strDocName = Left(strDocName, intPos - 1)
   strDocName = strDocName & ".rtf"
   oDoc.SaveAs FileName:=strDocName, _
       FileFormat:=wdFormatRTF
   oDoc.Close SaveChanges:=wdDoNotSaveChanges
   strFileName = Dir$()
Wend
End Sub
http://www.gmayor.com/installing_macro.htm

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I have a whole list of word files that need to be converted to rich
> test files to download into our EMR system and cannot figure out the
> best (easiest) way to do it.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.