PDA

View Full Version : SaveAs Dialog pointing to specified folder



Pathagoras
09-25-2011, 02:35 PM
I am trying to open the SaveAs dialog to a pre-detemined folder. Cannot seem to get it to work. Here is what I have tried:



foldername="MacIntosh HD:Users:joedoe:documents:forms:"
ChDir foldername
With Dialogs(wdDialogFileSaveAs)
CloseNum = .Show
End With

Invariably it simply opens the last folder opened, and not necessarily the target folder. How can I target the 'target' folder

mikerickson
09-27-2011, 06:42 PM
I don't know how to do that, but
1) you might try without the final colon. (It didn't work for me but I don't use Dir enough to be sure.)

2) This Excel Macro could be adapted to Word.

Dim myFileName As String

On Error Resume Next
myFileName = "False"
myFileName = MacScript("choose file name default location ""Macintosh HD:Users:merickson:Desktop:MailAutomation"" as alias")
On Error GoTo 0

If myFileName = "False" Then Exit Sub: Rem cancel
ThisWorkbook.SaveCopyAs myFileName

Pathagoras
09-28-2011, 04:43 AM
Yessssss!!!! Thank you. Only change was last line:

ActiveDocument.SaveAs MyFileName

Thanks again.