F
FotoArt
hello everyone
I'm using the following code to append some files.
the problem is it is appending first the last one I select.
I need to reverse this order.
I want the first file selected to be at the top of the final document. And
the second one second and so on.
Sub joinSelectedFiles()
Dim fd As FileDialog
Application.ScreenUpdating = False
Documents.Add
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Selection.InsertFile FileName:=(vrtSelectedItem), _
ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.InsertBreak Type:=wdSectionBreakNextPage
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub
any help would be appreciated
thanks
ahmed
I'm using the following code to append some files.
the problem is it is appending first the last one I select.
I need to reverse this order.
I want the first file selected to be at the top of the final document. And
the second one second and so on.
Sub joinSelectedFiles()
Dim fd As FileDialog
Application.ScreenUpdating = False
Documents.Add
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Selection.InsertFile FileName:=(vrtSelectedItem), _
ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.InsertBreak Type:=wdSectionBreakNextPage
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub
any help would be appreciated
thanks
ahmed