![]() |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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] |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
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] |
|
#5
|
|||
|
|||
|
Thank you. That works!
|
|
|
|
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 |
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 |