![]() |
|
#1
|
|||
|
|||
![]()
In a macro for WORD I want some code that will show the file opening dialogue box; so that, once there, I can choose the particular document I need and open it (then the macro will go on to execute other lines) - the equivalent to, in EXCEL
Code:
Application.FindFile Same thing for saving: some code that will show the file saving dialogue box; once there, I will give my document the name I want and choose a directory to save it in (then the macro will go on running lines). In the VB aid from WORD I see only code that already includes the name of one file; and of course, only that one file can get opened/saved with such code. Thanks for any help ACA |
#2
|
|||
|
|||
![]()
Solution for opening files.
I’ve found some code, originally for filtering files, that does open them. After pruning off several lines not needed for just one file, I am left with the macro below, that works O.K. Now, I don’t need the “For Next” loop, as I am opening just one file each time I run the macro. But the line in the middle, by itself, is not accepted; it must be altered in some way that I don’t know. Any help with just that, please? Thanks a lot. ACA Code:
Sub Macro1() ' ' Macro1 Macro Dim fd As FileDialog Set fd = Application.FileDialog(msoFileDialogFilePicker) Dim vrtSelectedItem As Variant fd.Filters.Clear If fd.Show = True Then For Each vrtSelectedItem In fd.SelectedItems Documents.Open FileName:=vrtSelectedItem ‘How must this line be altered so that it'll work by itself, without the loop?. Next vrtSelectedItem End If End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Jamal NUMAN | Word | 1 | 06-24-2011 03:52 AM |
![]() |
Qwerty | Office | 3 | 03-26-2011 07:41 PM |
Saving VBA | skib | PowerPoint | 0 | 02-18-2011 12:59 AM |
![]() |
originale | Outlook | 18 | 09-25-2009 03:02 PM |
problem with a saving doc | grigdordik | Office | 0 | 08-06-2009 07:09 AM |