Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-26-2015, 10:42 AM
mpd mpd is offline Word macro question Windows 7 32bit Word macro question Office 2007
Novice
Word macro question
 
Join Date: Aug 2015
Location: Cincinnati
Posts: 3
mpd is on a distinguished road
Default Word macro question

I'm putting together a word macro with the ultimate goal of upon execution the macro looping through all rtf files in a folder and saving them as docs. In it's current state the macro loops through the files as expected. However i'm required to click the save button for each file. Ideally it would automatically take care of this. Any guidance would be greatly appreciated. Here's the macro in it's current state:



Code:
Sub RTFtoDOC()
Dim FName As String
Dialogs(wdDialogFileOpen).Show
Application.ScreenUpdating = False
FName = Dir("*.rtf")
While (FName > "")
  Application.Documents.Open FileName:=FName _
  , ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
  PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
  WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
  wdOpenFormatAuto, XMLTransform:="", Encoding:=1252
  ActiveDocument.SaveAs FileName:=FName, FileFormat:=wdFormatDocument
  ActiveDocument.Close
  'SaveChanges:=wdSaveChanges
  FName = Dir()
Wend
Application.ScreenUpdating = True
End Sub

Last edited by macropod; 08-26-2015 at 05:04 PM. Reason: Added code tags & formatting
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word macro question Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM
Word macro question Question about macro in word 2013 tombags Word 1 06-25-2014 04:56 PM
Word macro question Macro Needed to Insert Asnwer to A Question in Multiple Choice Format Question rsrasc Word VBA 7 03-28-2014 12:28 PM
Word macro question A newbie question: a must to save macro word file as .docm? tinfanide Word VBA 6 12-06-2011 03:02 PM
Word macro question Macro question PaulY Word VBA 1 12-22-2010 11:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:03 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft