View Single Post
 
Old 04-28-2022, 07:11 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Quote:
Originally Posted by speckledegg View Post
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.
That is to be expected.
Quote:
Originally Posted by speckledegg View Post
If I keep the original name (as per your original code) and run the macro on the mailmerged document, I get the runtime error.
One apparent error in your code concerns:
Code:
        'StrFolder = .DataFields("Folder") & "\"
        StrName = .DataFields("Folder_Name") & "_" & .DataFields("Last_Name")
which should be:
Code:
        StrFolder = .DataFields(Folder_Name") & "\"
        StrName = .DataFields("Last_Name")
To see why, look at the .SaveAs line...

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]
Reply With Quote