+ Reply to Thread
Results 1 to 2 of 2

Bizarre Header Copy Paste Issue

  1. #1
    Registered User
    Join Date
    09-10-2019
    Location
    Colorado
    MS-Off Ver
    Office 2016
    Posts
    1

    Bizarre Header Copy Paste Issue

    Hello,

    I'm writing a sub that will merge word docs without changing any formatting. It is working perfectly for the body of the paper, and the footer is the same in all of the documents so no issues there. The headers change in each document, all of them being of the primary type because each page of each document has the same header (they are basically chapters of a document that were written by different individuals and the client wants a copy of all of them together in a single docx file). I have the code look at the page and section count in each document and select the last n pages of the original doc, right after pasting the WholeStory in. I then make a Copy of the HeaderFooter, go to the combined doc to be added to, select the last n pages, unlink to previous all headers and copy paste in the header onto those n pages. In a 20 document merge, 15 of them are behaving exactly as I want them to. The puzzling thing is that some of the docs are expanding the header paste into the previous section even though it is outside the selected page range. I suspect it has something to do with my sections count but sections (long) isn't explained well in Microsoft's word VBA documentation and most of my VBA experience is in excel. One solution I tried was to have a continuous section break followed by a full section break after each chapter is added. I also tried reducing the number of selected pages in each pasted doc, and it changed nothing and resulted in a mess in the headers that were working. I also did step-throughs and message boxes to try to debug it. Do you have any ideas about what I did wrong here? Thanks! (Unfortunately I can't share the code due to my noob status).

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Bizarre Header Copy Paste Issue

    See: https://www.msofficeforums.com/word-...documents.html
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Bizarre issue importing with VBA script and wildcards
    By atombomb99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2019, 06:51 PM
  2. Bizarre issue going on in Excel 2010
    By Brendadob in forum Excel General
    Replies: 8
    Last Post: 06-29-2014, 02:16 PM
  3. [SOLVED] Bizarre paste problem with 2013 - sometimes!
    By gsullymorgan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2014, 09:43 AM
  4. Bizarre VBA Looping issue...
    By valverde311 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2011, 04:25 PM
  5. Replies: 7
    Last Post: 12-20-2005, 06:35 PM
  6. Replies: 4
    Last Post: 11-28-2005, 03:50 PM
  7. [SOLVED] Bizarre Excel Copy/Paste Date Issue
    By Rob in forum Excel General
    Replies: 2
    Last Post: 08-30-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1