#1
|
|||
|
|||
Problem merging to separate docs
I'm having the same problem as described in https://www.msofficeforums.com/mail-...rate-docs.html, but I've narrowed it down to Runtime Error '5852' Requested object is not available - it seems to be linked to .Destination = wdSendToNewDocument
I don't know anything about coding - I just needed a macro so I can split merged documents into separate files so I too would love to know how to fix this. Last edited by macropod; 04-28-2022 at 03:10 PM. Reason: Split to new thread |
#2
|
||||
|
||||
That line is just standard Word VBA. Are you running this from Word?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Yes; I tried running it with and without the renaming. If I run it from Word with the renaming, then nothing happens after you select "Edit Individual Documents" - it just appears to do nothing.
If I keep the original name (as per your original code) and run the macro on the mailmerged document, I get the runtime error. For this whole exercise, I am using an Excel spreadsheet as the source, and mailmerging a Word document (using the spreadsheet to populate fields in a letter). I hope that makes sense. |
#4
|
||||
|
||||
Quote:
Quote:
Code:
'StrFolder = .DataFields("Folder") & "\" StrName = .DataFields("Folder_Name") & "_" & .DataFields("Last_Name") Code:
StrFolder = .DataFields(Folder_Name") & "\" StrName = .DataFields("Last_Name") Apart from that, there is no obvious reason why the runtime error would have anything to do with: Code:
.Destination = wdSendToNewDocument
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Thanks for the continued help;
This has helped me a lot actually, as I believe that Note 3 in the original guide may not have been followed correctly (at least in my code, I can't say for the OP's). One of the things I was trying to do was use a text and field combination for the filenames, and I couldn't get that to work. I've now just added the field for filename in the data source and that seems to work fine. Thank you! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merge into Separate Docs | chrnon | Mail Merge | 1 | 04-27-2022 03:08 PM |
Merging of colums from two different docs & create a new doc | ranjan | Word VBA | 9 | 08-31-2021 08:25 AM |
Extra blank page at end of each document when merging to separate documents. | Blondyvl | Mail Merge | 1 | 12-03-2020 04:33 PM |
Merging Various .docs Via Q&A | Wants_It_Simple | Word | 1 | 06-30-2014 10:26 PM |
Adding identical footers to 187 separate docs | sqzdog | Word | 11 | 10-31-2011 01:46 AM |