Protect Documents After Merge?

A

Antonimo

I am trying to merge data into separate Word docs that I am merging to
"electronic mail" (Word 2000) and sent as e-mail attachments.

So far so good, however, there are two issuse:

1. How do I protect the documents after the merge? (I can't do a merge
while the document is protected so it must be unprotected for the merge
process - or?)

2. How do I create a message for the email to which the document is
attached? Currently, the e-mail messages are totally blank.
 
D

Doug Robbins - Word MVP

Hi Antonimo,

You would need to use something like the following to split the merged
document into separate documents:

Sub splitter()

' splitter Macro

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

Dim Letters As Integer, Counter As Integer
Letters = ActiveDocument.Sections.Count
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
DocName = "Myletter" & LTrim$(Str$(Counter))
ActiveDocument.Sections.First.Range.Cut
Documents.Add
Selection.Paste
ActiveDocument.Sections(2).PageSetup.SectionStart = wdSectionContinuous
ActiveDocument.SaveAs FileName:=DocName, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
Counter = Counter + 1
Wend

End Sub

using an ActiveDocument.Protect statement applying the desired form of
protection before the ActiveDocument.SaveAs statement.

Then you could use the procedure in the article "Mail Merge to E-mail with
Attachments" at

http://www.mvps.org/word/FAQs/MailMerge/MergeWithAttachments.htm

To do the email bit.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
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