Protecting Merge documents

D

d. williams

I've got someone who wants to protect the original document and the
resulting merged document from being changed in any way other than the
merged fields. Protecting the original doc doesn't work since the resulting
merged doc is read/writable.

Any suggestions?

Thanks,
Diane
 
D

Doug Robbins - Word MVP

You could use a macro to split the document into individual documents - one
for each record in the data source and protect each one.

Sub splitter()

' splitter Macro

' Macro created by Doug Robbins to save each letter created by a mailmerge
as a separate file.

'modified to protect each document for forms.

Dim i As Long, Source as Document, Target as Document, Letter as Range
Set Source = ActiveDocument
For i = 1 to Source.Sections.Count
Set Letter = Source.Sections(i).Range
Letter.End=Letter.End-1
Set Target = Documents.Add
Target.Range=Letter
Target.Protect wdAllowOnlyFormFields
Target.SaveAs FileName:="Letter" & i
Target.Close
Next i

End Sub


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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