Merging Multiple documents having different headers and footers ma

Dear All,

I am trying to merge a several word/rtf documents into a single word 
documents with the below macro, the problem is now each document is having a 
different header and footer and some fields, 
Can anyone suggest me a macro code for merging multiple word documents into 
a single document without disturbing the headers and footers of each document?

Sub MergeDocs()
    Dim rng As Range
    Dim MainDoc As Document
    Dim strFile As String
    Const strFolder = "c:\tes\" 'change to suit
    Set MainDoc = Documents.Add
    strFile = Dir$(strFolder & "*.doc") ' can change to .docx
    Do Until strFile = ""
        Set rng = MainDoc.Range
        rng.Collapse wdCollapseEnd
        rng.InsertFile strFolder & strFile
        strFile = Dir$()
    Loop
End Sub

Thanks in advance.
2
Utf
12/9/2009 9:07:01 AM
office.misc 2235 articles. 0 followers. Follow

0 Replies
1555 Views

Similar Articles

[PageSpeed] 23

Reply:

Similar Artilces:

Pivot table, calculating % difference of subtotal rows
This is what I need to do: I have rows of data in a pivot table that have subtotals associated with them (automatically generated via the pivot table). I need to to take the subtotals for 2009 and 2010 and calculate the % difference. Here's a screenshot of what I'm talking about: http://home.comcast.net/~wilsoch/PercentDiff.jpg Is this even possible or am I going to have to do this manually? Hi I have'nt seen the screenshot as am at work , go to Pivot Table>Formulas>Calculated Field wilsoch@comcast.net wrote: >This is what I need to do: I have rows of ...

Word was unable to compare the documents
I have two 147 page Word 2007 documents that I am trying to compare that also contain equations. When I try to compare them, Word generates the following error: Word was unable to compare the documents I am not really finding anything useful using Google to search so I am posting here. I did find KB978398, requested the hotfix, and after installing the hotfix I still have the same error. Suggestions? Thanks! ...

Identical Name on multiple workbook pages
As a hardened Excel/VBA nut, I'm probably going to be really embarrased when I get the answer to this, but here goes... I have a workbook containing a worksheet that records weekly data. I have a named range ("Data") which I select then clear, via GoTo. Each week, I copy the latest week's worksheet and create a new worksheet for the new week. And each week, I select the range "Data" and clear it in the most recently created worksheet. the thing is, I always thought that Range names were unique across a workbook, and that you couldn't have the same Range N...

Outlook 2003 acquiring multiple instances of a message store
Hi, I've been working on a project involving a MAPI message store provider and I've noticed some peculiar behaviour with Outlook 2003. Specifically it seems that Outlook invokes the MSProviderInit() function on three separate occasions, and I'd like to understand why. The first two invocations occur directly after I access the message store for the first time. The third occurs some (indeterminate) time later (normally between 15 and 20 seconds after Outlook is launched). What on earth is it doing? Why does Outlook 2003 require three separate instances of a message store. This fun...

mporting multiple text files into Excel with corresponding filenames
Dear members, I need to import 100+ text files into Excel. In addition I want Excel to show corresponding filename (where the data comes from) in each row. How do I accomplish this? TIA Hi Take a look at Ron de Bruin's site. He has lots of code examples to consolidate files. http://www.rondebruin.nl/tips.htm -- Regards Roger Govier "avi" <avi38521@gmail.com> wrote in message news:9194d7dc-21bb-4fd9-8ecb-aa301a54f7d1@b2g2000yqi.googlegroups.com... > Dear members, > > I need to import 100+ text files into Excel. > > In addition ...

Changing font style/size/color/etc for multiple series in a chart?
I have a stacked bar chart (but note applies to all charts) that I have added data labels to in Excel 2007. However, the data labels are the wrong font size and color. When I go to format data labels in the "Labels" section of the Chart Tools/Layout ribbon, there is no apparent option to change font. I can right click on a single series and change it, but doing that for every series in a complex chart seems ludicrous. Is there any way to change the font for multiple series in one step? The same holds true for changing the number format or any other characteristic for m...

How do I stop my Publisher 2003 document from saving as a webpag.
When I save a particular publication ( a newsletter) in Publisher 2003 as a Publisher 2000 document (so I can work on it elsewhere) it opens as a web page instead of a print document. When I convert it back to print, I lose a few inches of print on the left page that just don't print even when I change the margins. The missing print shows on the screen normally, it is only in print preview and on paper that it cuts off. Can I stop this from happening? Can I retrieve the missing print? Please help! You may have to reconstruct this publication. -- Mary Sauer MSFT MVP http://off...

Allen Browne Client Search Multiple Like Statements
Hi all, I need to have this code search multiple fields, but I keep getting "Expected end of statement" on the Me in the second to last line: If Not IsNull(Me.txtFilterMainName) Then 'strWhere = strWhere & "([MainName] Like ""*" & Me.txtFilterMainName & "*"") AND " strWhere = strWhere & "([Address1] Like ""*" & Me.txtFilterMainName & "*"") OR " & _ strWhere = strWhere & " ([StreetName] Like "" * " & Me.txtFilterM...

Adding Values From Different Tabs
Is there a way to add values from different tabs on the same spreadsheet? For example A2 from tab 1 and A2 from tab 2 -- Flipkid2 ------------------------------------------------------------------------ Flipkid2's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=17984 View this thread: http://www.excelforum.com/showthread.php?threadid=398184 Assuming the name on Tab 1 is Sheet1 and Tab 2 is Sheet2, use thi formula: =Sheet1!A2+Sheet2!A2 note the name of the sheet is followed by "!" to indicate it is a shee name. HTH Bruc -- swatsp0 ------------...

Use Outlook Client when domain user name different with email acco
Hello, I have a question about using Outlook Client. If the domain user login name is different with email account which belong to a same person, is it possible to install / login with the Outlook client? e.g domain user : degdom\apple email account: applewatson@deg.com One of my client is facing in this situation. I just want to have some preparation before install Outlook Client for him. Thanks for any help! Hi Huimc, It shouldn't be a problem if the AD user is the same used to start Outlook and connect to CRM. You may want to check the email adress in CRM if the ema...

Support of multiple users in Outlook?
Hi, Palm convert here with a question. In my Palm desktop I was able to separate my Notes, Calendar, Tasks, etc. from my wife as a separate user. We both had palm devices and each maintained separate schedules on our devices and on the desktop. How do we do that in Outlook? Thanks, John "John" <ljohnwu@yahoo.com> wrote in message news:u2bnY$0DGHA.3528@TK2MSFTNGP12.phx.gbl... > Hi, > > Palm convert here with a question. > > In my Palm desktop I was able to separate my Notes, Calendar, Tasks, etc. > from my wife as a separate user. We both had palm ...

Truncated Merged Cells
Actually, I have truly MERGED cells that contain LINKS to other workbooks. The merged cells were created exactly as you described and the data within them (text) comes from several other workbooks, with the appropriate references. We created them in 95 and later converted them to 97. We can use them in Excel XP but they lose the data that would be displayed on 2002 and 2003. Have not tried 2000 yet. Thanks for the help. We are very concerned about this problem. Our workbooks are complex with many links. Elsa I only have the ideas that I already posted. And you can find posts in goog...

Using mail merge for nametags, how'd you get 8 diff. on each pg?
How do I print off a different name on each name tag in order to print them out a page at a time? I entered the names in mail merge and it will print them, just a whole page of each. Thanks "juliehrbacek" wrote: > How do I print off a different name on each name tag in order to print them > out a page at a time? I entered the names in mail merge and it will print > them, just a whole page of each. > > Thanks This is the same question that has brought me here. I've been trying to figure it out for over 2 hours now and am about ready to pull my hair ou...

Multiple POP accounts in Outlook 2003
Hello, I have multiple POP accounts on my Outlook 2003 client. How do i setup Outlook to save mail from the multiple POP accounts to different folders so that it makes it easier for me to sort out my mail? TIA! //j you'll need to use rules... or use search folders configured for each account. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: ...

New Document
Hi, I'm using the MFC document/View architecture, or at least I'm trying to do so. The Image Processing software I'm developing, returns an image (a matrix of points), and other information in a class call Image CImage { //Attributes CArray figure; int tenderness .... } I was wondering to create a new class. let's say CImageDoc : public CDocument, to display and use manipulate my application data. My problem is I can't create an instance of the CImageDoc class, the command CImageDoc myNewImageClass; dosn't work. How do I create a new do...

How to use ampersand in footers like CS&S
I am defining my project plan and I have to place proprietary footers on the document. When I use the ampersand in the footer it displays the time and not the acronym for my company such as CS&S. It will show CS&[Time] and then display the time on my printouts. If I use a double ampersand it does the same thing. How can I use the ampersand as needed in my company Acronym CS&S? You could always paste the company logo as a graphic into the footer? Maybe use it as a field somewhere and add the field to your footer. "Sue" wrote: > I am defining my ...

Publisher 2002 Mail Merge Problems
Hi! I posted an inquiry on 2/21/04 regarding problems I'm having doing a mail merge in Publisher 2002 (using W98SE). I read a post that said I may need to intall MDAC file from MS...I did so and restarted my PC, but Publisher still freezes after opening the source file (in this case an Access database)and doesn't allow me to go to the next step. Any other advise? I may end up just printing labels and affixing them to the postcards I'm trying to mail merge information into...your help is appreciated! Use a CSV (Comma Separated Value) file. That will work. In Excel you g...

Running macros for different cells at the same time
Hi all, Is it possible to run different macros on different cells at the sam time? If so how do I go about setting it up? Cheers Michae -- Message posted from http://www.ExcelForum.com Hi not really sure what you're trying to do. Could you give an example? -- Regards Frank Kabel Frankfurt, Germany > Hi all, > > Is it possible to run different macros on different cells at the same > time? If so how do I go about setting it up? > > Cheers > > Michael > > > --- > Message posted from http://www.ExcelForum.com/ Yes it is possible to run different m...

Two Outlook 2000 boxes merge to one
Hi: User A: Left the Company Several weeks Ago. User B: Used User "A" email box until she got hired on a Perm basis. Issue: User B now has her own inbox but would like to have all of the 1500 hundred emails and folders in USER "A" in box transferred to her new in box. OBvioulsy she could simply forward these emails to her own box BUT I wanna know if there is another way to get the present info from USEr "A" inbox to transferred USer "B" in box? Can the two in boxes some how merge? Once this "merge" has taken place USER A in box ...

Group Header 06-02-07
How do you show or carry a Group Header over to the next page when the detail section goes to the next page on a report? Thanks DS DS wrote: >How do you show or carry a Group Header over to the next page when the >detail section goes to the next page on a report? Use the group header's RepeatSection property. -- Marsh MVP [MS Access] Marshall Barton wrote: > DS wrote: > > >>How do you show or carry a Group Header over to the next page when the >>detail section goes to the next page on a report? > > > > Use the group header's RepeatS...

How to add multiple message senders to the blocked list automatica
-- Steve ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/office/community/en-us/default.mspx?mid=5597e420-8dc2-4fc5-88df-130a7cc9fe32&dg=microsoft.public.outlook ...

MC++ & C# generate different XML
Hi, I've been trying a long time now to generate some XML using MC++ and XmlSerializer. I have a piece of C# code that produces exactly what I want, but I simply can't get the MC++ code to write the same thing. Below I have included two minimal compilable samples that illustrate my problem. The C# code produces this XML: <?xml version="1.0" encoding="utf-8"?> <LandXML xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Units name="unit1" /> <Units name="un...

conditional formatting: separating rows with differing values
Hi, Need help with conditional fomatting. What I need: I got a worksheet with 950 rows and 5 columns. The first row contain the headers. Columns A, B, D and E contains unique values. But the column C contains text values which repeats sequentially for 6-7 rows and changes thereafter. Now I want to put up a line (using border) through the whole row dividing this transition row. My Idea: Compare C2 with C3, if equal do nothing. Then compare C3 with C4 and so on till 2 consequtive values differ. Now divide the 2 rows using the border formatting option in conditional formatting dialog box. So...

Transfer combined investment transactions to multiple new accounts
In Money 2005 Deluxe, I have an investment account (with related cash account) with about two years of transactions. This mutual fund account (TRP) uses a separate account number for each mutual fund holding so that when I upgraded to Money 2005 and set up on line services for this account it downloaded each mutual fund investment as a new account. I can't merge all of these duplicate accounts in Money as it only allows you to merge one time so I then transfered (using copy) all my investment transaction from the combined existing account to each of the new individual investment ac...

Splitting multiple cell contents from 1st column into 4 columns
n my first column I have 4 cells (1-4) (5-8) etc. with general content. The content from each of these 4 cells needs to be placed in a separate column to make a list that I can sort etc. Example: COLUMN A 1 01-04-425-001 2 Heatherridge Road #301 3 Harry Smith 4 H25 Condo Fairfax Place 5 01-05-356-041 6 McGrath Street # 56 7 Mary Jones 8 B45 Condo Lemon Circle . . . . . . and so on and so on every 4 cells. I have hundreds of 4 cell descriptions. I just can't do this one by one. Can anyone help, PLEASE, PLEASE. I am really a novice at Excel though I use it for e...