Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2025, 12:39 AM
Alyb Alyb is offline Save document, move to Downloads, quit Word Mac OS X Save document, move to Downloads, quit Word Office 2016 for Mac
Novice
Save document, move to Downloads, quit Word
 
Join Date: Jan 2023
Posts: 8
Alyb is on a distinguished road
Default Save document, move to Downloads, quit Word

I'm using Ms Word on my Mac and have a VBA macro that automatically fills in a form.rtf. I'd like to take the automation a step further.



After the information is filled in, the document should be moved to the downloads folder on my Mac (/Users/hl/Downloads) and then Ms Word should quit.

How can I accomplish this?

Thanks in advance!

Hans
Reply With Quote
  #2  
Old 03-14-2025, 02:05 AM
macropod's Avatar
macropod macropod is offline Save document, move to Downloads, quit Word Windows 10 Save document, move to Downloads, quit Word Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,465
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

Rather than moving the document, simply save it in your Downloads folder. For example:

Code:
ActiveDocument.SaveAs FileName:= "/Users/hl/Downloads/FileName.docx", FileFormat:=wdFormatXMLDocument, AddToRecentFiles:=False
ActiveDocument.Close
Application.Quit
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-14-2025, 02:23 AM
Alyb Alyb is offline Save document, move to Downloads, quit Word Mac OS X Save document, move to Downloads, quit Word Office 2016 for Mac
Novice
Save document, move to Downloads, quit Word
 
Join Date: Jan 2023
Posts: 8
Alyb is on a distinguished road
Default

Thank you.
What would be the code to remove the rtf from the desktop afterwards?

Last edited by Alyb; 03-14-2025 at 11:24 PM.
Reply With Quote
  #4  
Old 03-14-2025, 05:17 PM
macropod's Avatar
macropod macropod is offline Save document, move to Downloads, quit Word Windows 10 Save document, move to Downloads, quit Word Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,465
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

I'm not familiar with the Mac OS, but in Windows, you'd use something like:
Code:
Dim StrNm As String: StrNm = ActiveDocument.Fullname
ActiveDocument.SaveAs FileName:= "/Users/hl/Downloads/FileName.docx", FileFormat:=wdFormatXMLDocument, AddToRecentFiles:=False
ActiveDocument.Close
Kill StrNm 
Application.Quit
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-14-2025, 11:38 PM
Alyb Alyb is offline Save document, move to Downloads, quit Word Mac OS X Save document, move to Downloads, quit Word Office 2016 for Mac
Novice
Save document, move to Downloads, quit Word
 
Join Date: Jan 2023
Posts: 8
Alyb is on a distinguished road
Default

Thank you. That works!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word for Mac doesn't quit Alyb Word VBA 2 11-19-2024 12:37 AM
VBA to save word document as pdf to default location with inputbox to “save as” with filename sugge richardgo Word VBA 0 11-18-2020 09:36 AM
Save document, move to Downloads, quit Word microsoft word doc downloads will not open blabla20 Word 2 12-23-2014 07:50 AM
Word ask to save template whenever i save a derived document jorbjo Word 3 10-04-2012 10:52 AM
Word Crash on Quit masomenos Word 2 11-09-2010 12:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:18 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