+ Reply to Thread
Results 1 to 1 of 1

Word macro - File Save As - not working

Hybrid View

  1. #1
    Registered User
    Join Date
    11-24-2023
    Location
    Houston, TX
    MS-Off Ver
    Office 365
    Posts
    2

    Word macro - File Save As - not working

    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
    msoFileDialogOpen
    instead of
    msoFileDialogSaveAs
    . Now the Save As seems to be working properly. Time for a different post.
    Last edited by gshockxcc; 12-20-2023 at 09:25 AM. Reason: New info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 04-18-2023, 05:06 AM
  2. [SOLVED] Multi Word Docs Using Word Template and Excel list save as file name VBA (UPDATED)
    By DaveW1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-15-2022, 04:19 PM
  3. Replies: 1
    Last Post: 09-05-2013, 02:39 PM
  4. Replies: 0
    Last Post: 01-27-2013, 12:13 PM
  5. Macro to open Word file from Excel not working
    By bryan444 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-31-2012, 04:46 AM
  6. [SOLVED] Macro to save mail merged word docs to users desktop and with a desired file name
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2012, 12:27 PM
  7. Click SAVE to save new file - not working correctly
    By vettenfun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-05-2011, 12:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1