Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-10-2020, 09:24 AM
Pramod Pramod is offline How to merge multiple header into one word file Windows 10 How to merge multiple header into one word file Office 2016
Novice
How to merge multiple header into one word file
 
Join Date: Jun 2020
Posts: 1
Pramod is on a distinguished road
Default How to merge multiple header into one word file


I need code for Merge multiple header into one word file. Help me for the same.
I have mentioned the below code is for merge multiple word file into one.
Code:
Sub MergeMultiDocsIntoOne()
  Dim dlgFile As FileDialog
  Dim nTotalFiles As Integer
  Dim nEachSelectedFile As Integer
Set dlgFile = Application.FileDialog(msoFileDialogFilePicker)
 
  With dlgFile
    .AllowMultiSelect = True
    If .Show <> -1 Then
      Exit Sub
    Else
      nTotalFiles = .SelectedItems.Count
    End If
  End With
 
  For nEachSelectedFile = 1 To nTotalFiles
    Selection.InsertFile dlgFile.SelectedItems.Item(nEachSelectedFile)
    If nEachSelectedFile < nTotalFiles Then
      Selection.InsertBreak Type:=wdPageBreak
    Else
      If nEachSelectedFile = nTotalFiles Then
        Exit Sub
      End If
    End If
  Next nEachSelectedFile
End Sub

Last edited by macropod; 06-10-2020 at 03:43 PM. Reason: Added code tags
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to merge multiple header into one word file Mail Merge: Using One Excel File with Multiple Sheets Townshend Mail Merge 19 06-25-2021 12:39 AM
Extract Document ID and description from header in multiple Word documents and paste in new word doc venkat_m Word VBA 2 05-23-2020 03:57 AM
How to merge multiple header into one word file Replace specific word inside a table in the Header with Merge field Turin74 Word VBA 3 06-06-2019 06:17 PM
How to merge multiple header into one word file Merge one Excel file into multiple Word Documents Rushpac Mail Merge 2 01-27-2017 02:49 PM
Mail Merge using Word 2010 - Header source not be recognized Gage262 Word 8 02-01-2012 11:08 AM

Other Forums: Access Forums

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