I have the following code that I'm using to open an .RTF file. The File Open dialog seems to be working fine, but when I try to save the file, it's not actually saving. The File Save dialog opens, and I can navigate to a file location as needed, enter the file name, but it doesn't actually save the file. I'm trying to have the File Save dialog allow me to save the file, rather than coding the filename into the macro. I found a link on the Learn.Microsoft reference page, but apparently I am not allowed to post links yet.
Sub SaveAsRTF()
ActiveDocument.SaveAs2 FileName:="Text.rtf", _
FileFormat:=wdFormatRTF
End Sub
' Open the RTF file
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = False
.Show
End With
'Save the file as .docm
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
dlgSaveAs.Show
Application.FileDialog(msoFileDialogOpen).AllowMultiSelect = False
Application.FileDialog(msoFileDialogOpen).Show
I have done some searches on the forum, and wasn't able to find anything related. If I missed it, my apologies for the redundancy. Not sure what I'm missing.
I figured out my error. I accidentally copy/pasted the
instead of
. Now the Save As seems to be working properly. Time for a different post.
Bookmarks