Mail merge to create individual documents (Xpost)

Joined
Apr 20, 2010
Messages
9
Reaction score
0
Cross posted from https://www.pcreview.co.uk/forums/showthread.php?p=13939115

The thread above has a useful macro to split a merged document and save it as separate ones with sequential names. Two of us though would like further help - text as posted there follows:

I want to be able to amend the macro so it names each document with data from one of the merge fields (a name or an ID no - not necessarily sequential) and the existing document name. So MarReports would become say 3672MarReports, 3675MarReports etc or CLSMarReports, SALMarReports etc.

Also have a nuisance issue which I think is easier to solve.
The master & merged single document have Font Arial & single line spacing whereas the created documents are going to the new default of Calibri & 10pt below each line/1.5 line spacing, whatever it is. How can I force the new doc to take up all the parameters of the merged one (it does keep a wierd margin I have in place to allow for an offcentre letterhead, so I don't think it's entirely defaulting to the Normal template)

I have tried a search, because I'm sure this has probably been answered elsewhere, but couldn't even find the original post, let alone one answering this ... I'm obviously rubbish at defining my terms.

Thanks in anticipation.
 
Joined
Apr 20, 2010
Messages
9
Reaction score
0
A bump, but with some suggestions

I've had a look around & it seems that it is possible to pick up the nth to the (n+x)th characters in a document. This means that we could get round the naming problem if we insert the relevant field right at the start of the document (so that after merging each letter starts with the correct reference) then replace LTrim$(Str$(Counter))in the line
Code:
 DocName = "Myletter" & LTrim$(Str$(Counter))
with code that will pick up the first (let's say) 4 characters.

Problem is, as someone who has only used VBA in Excel before, I don't know the syntax or how to find out the character number of a particular bit of text. (Well, I can guess the latter, but is a return a single character? or none? or 80?) And Word's own VBA help files & articles - on & offline - are still above my head.

So, can anyone help with this (possibly) simpler question?

And any idea what to do to make the new document it creates have the same formatting as the source document rather than that of 'Normal'? Is there an equivalent of the Excel PasteSpecial command for retaining the formatting?

Thanks in advance for any light anyone can shed on this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top