By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,824 Members | 2,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,824 IT Pros & Developers. It's quick & easy.

GetSaveAsFilename

P: 18
This is an extract from a working(!) VBA programme in Excel.

Expand|Select|Wrap|Line Numbers
  1.     fs = Application.GetSaveAsFilename("C:\Data")
  2.  
What is the equivalent VBA code for Word? I cannot find it! Any help would be appreciated.

Thanks

Bertie
Apr 25 '07 #1
Share this Question
Share on Google+
4 Replies


Expert 5K+
P: 8,434
I'm far from expert in this area, but I don't think there is a direct equivalent. You might need to play with the FileDialog object to produce something similar.
Apr 25 '07 #2

P: 18
I'm far from expert in this area, but I don't think there is a direct equivalent. You might need to play with the FileDialog object to produce something similar.
I have, but with no success so far; hence my plea for help ...

Thanks anyway.

B
Apr 26 '07 #3

Expert 5K+
P: 8,434
Well, I just wrote this macro in Excel, then tried it in Word. It worked in both.
Expand|Select|Wrap|Line Numbers
  1. Sub aaa()
  2.   Dim fd As FileDialog
  3.   Dim fn As String
  4.  
  5.   ' Create a FileDialog object as a File Picker dialog box.
  6.   Set fd = Application.FileDialog(msoFileDialogFilePicker)
  7.  
  8.   With fd
  9.     .AllowMultiSelect = False
  10.     .InitialFileName = "C:\Data"
  11.     .Title = "Save As..."
  12.     .Show
  13.     fn = .SelectedItems(1)
  14.   End With
  15.   Set fd = Nothing
  16.   Debug.Print "Selected file = ["; fn; "]"
  17. End Sub
Apr 26 '07 #4

P: 18
Thanks! Works fine.

B
May 18 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.