Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 06-10-2020, 03:45 PM
macropod's Avatar
macropod macropod is offline How to merge multiple header into one word file Windows 7 64bit How to merge multiple header into one word file Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See the Combine Multiple Word Documents 'Sticky' thread at the top of this forum: https://www.msofficeforums.com/word-...documents.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 06-10-2020, 04:23 PM
macropod's Avatar
macropod macropod is offline How to merge multiple header into one word file Windows 7 64bit How to merge multiple header into one word file Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: How to merge multiple header into one word file - Stack Overflow
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

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 03:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft