Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-14-2014, 12:29 AM
smndnm smndnm is offline refering to the msoFileDialogueOpen variants Windows 7 64bit refering to the msoFileDialogueOpen variants Office 2010 32bit
Novice
refering to the msoFileDialogueOpen variants
 
Join Date: Jul 2014
Location: Queensland
Posts: 24
smndnm is on a distinguished road
Default refering to the msoFileDialogueOpen variants

Hello,

How does one refer to the files selected by this code?

Code:
 
  Dim dlgOpen As FileDialog
 Set dlgOpen = Application.FileDialog( _
 FileDialogType:=msoFileDialogOpen)
 With dlgOpen
 .AllowMultiSelect = True
 .Show
 End With
I can count them with:
Code:
dlgOpen.SelectedItems.Count
But I am not understanding how to reference them and thus specifically process them (given that these will change at each running of the macro)
The intention is:
open and update doc1, click the "update all other docs" button.
This button saves doc1, opens the dialogue to multiselect the other required docs and then invokes a loop(?) to run through an "update-saveas" process on those docs.

I am going guess at:

Code:
Dim i As Integer
Dim "dlgopen.SelectedItems" as Variant
For i = 1 to dlgOpen.SelectedItems.Count
' Open Variant, Update links, Save As, Close
Next i
I think I can do the open, save-as and close (I have a working macro for this), but the question is:
How do I refer to each file selected so as to be able to process them?



Many Thanks from Queensland.
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refering figure number too text danzi Word 1 01-20-2012 12:13 PM
Refering to photos on other pages woodfind Word 1 05-17-2010 01:52 AM

Other Forums: Access Forums

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