Thread: [Solved] Word macro question
View Single Post
 
Old 08-26-2015, 05:05 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It seems to me your code could be reduced to:
Code:
Sub RTFtoDOC()
Dim FName As String
Dialogs(wdDialogFileOpen).Show
Application.ScreenUpdating = False
FName = Dir("*.rtf")
While (FName > "")
  Application.Documents.Open FileName:=FName, ReadOnly:=True, AddToRecentFiles:=False
  ActiveDocument.SaveAs FileName:=FName, FileFormat:=wdFormatDocument
  ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
  FName = Dir()
Wend
Application.ScreenUpdating = True
End Sub
PS: When posting code, please use the code tags - inserted via the # symbol on the posting menu.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote