Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-03-2014, 06:50 AM
gmaxey gmaxey is offline Combine Different Word files into one file and update Table of Content Windows 7 32bit Combine Different Word files into one file and update Table of Content Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,639
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You just need a function to define your static strFolder:

Code:
Sub TestMethods()
  MsgBox fcnFolderPicker_msoFileDialogMethod("Select folder")
  MsgBox fcnShellBrowseForFolder
End Sub
Function fcnFolderPicker_msoFileDialogMethod(strTitle As String, Optional strInitialPath As String = "C:\", Optional bAllowMulti As Boolean = False) As String
Dim strPath As String
Dim fDialog As FileDialog
  Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
  With fDialog 'Pick folder containing the files
    .Title = strTitle
    .AllowMultiSelect = bAllowMulti
    .InitialView = msoFileDialogViewList
    .InitialFileName = strInitialPath
    If .Show <> -1 Then
      fcnFolderPicker_msoFileDialogMethod = "Nothing selected, cancelled by user"
    Exit Function
    End If
    strPath = fDialog.SelectedItems.Item(1)
    fcnFolderPicker_msoFileDialogMethod = strPath
  End With
lbl_Exit:
  Exit Function
End Function

Function fcnShellBrowseForFolder(Optional strTitle As String, Optional strRootFolder As Variant) As String
  On Error Resume Next
  fcnShellBrowseForFolder = CreateObject("Shell.Application").BrowseForFolder(0, strTitle, 0, strRootFolder).Items.Item.Path
  On Error GoTo 0
lbl_Exit:
  Exit Function
End Function
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combine Different Word files into one file and update Table of Content Referencing + Automatic update of Shared Content in MS Word. mitucool Word 14 10-09-2013 02:08 AM
Combine Different Word files into one file and update Table of Content How to combine many word files in one file but to have correct pages numbers and tabl Jamal NUMAN Word 6 04-20-2011 02:32 PM
Combine Different Word files into one file and update Table of Content SOS - cannot update table of content properly Lee Word 5 02-04-2011 12:59 PM
A Table of Contents that Will Dictate the Content of the File ddhardy Word 0 06-23-2010 06:01 AM
Combine Different Word files into one file and update Table of Content Combine pst files? markg2 Outlook 2 04-26-2010 03:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:04 PM.


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