Password protected document can't be merged

E

Eddie

Hello all, I have a user that is trying to email merge a password protected
document to 69 recipients but can't. If she removes the password protection
she dosen't have a problem, but she needs the doc protected from any editing.
Any suggestions on how she can accomplish sending out this document in a
protected format?

She is using office 2003

Thanks,
Eddie
 
J

JE McGimpsey

Eddie said:
Hello all, I have a user that is trying to email merge a password protected
document to 69 recipients but can't. If she removes the password protection
she dosen't have a problem, but she needs the doc protected from any editing.
Any suggestions on how she can accomplish sending out this document in a
protected format?

She is using office 2003

Since this is a newsgroup for Word for Macintosh (hence the ".mac." in
the newsgroup name), you'd probably do better in one of the WinWord
groups, e.g.:

microsoft.public.word.application.errors

Though there are a number of WinWord experts here, too.

If you post there, it may be helpful to specify how your user is trying
to do the email merge.
 
J

John McGhie

Hi Eddie:

Hmmm.... The document that is sent out from a mail merge is a NEW document
that is a copy of the Main Document. So the password is never going to
carry through.

She would have to write a macro to perform the mail merge, then individually
set the password on the resulting documents before emailing.

She should also understand that a password does NOT protect a document from
"editing" if the recipient is determined. If they can read it, they can
change it. There is no such thing as a document that "cannot be changed" by
a determined recipient who can read it.

She may be better off to simply ask the recipients "please do not change
this document". If they want to do the right thing, they will leave it
alone. If they are determined to do bad things, there is no format that
will prevent them doing so. It's the old story of "Locks only keep out
honest people".

What she COULD do (only on a PC...) is "Digitally Sign" the document. That
won't "prevent" changes, but it will instantly reveal the fact that the
document has been changed.

Hope this helps

Hello all, I have a user that is trying to email merge a password protected
document to 69 recipients but can't. If she removes the password protection
she dosen't have a problem, but she needs the doc protected from any editing.
Any suggestions on how she can accomplish sending out this document in a
protected format?

She is using office 2003

Thanks,
Eddie

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 
C

CyberTaz

Hi John -

In order for the attachments to be created doesn't the original have to be
"opened" each time? If so it wouldn't be possible for the attachment to be
created since the doc couldn't be "read".

Regards |:>)
Bob Jones
[MVP] Office:Mac
 
J

John McGhie

Hi Bob:

Quite correct, you can't merge to a document that can't be opened. So you
would have to specify the password.

But if you were using VBA, you could specify the password to open in the
code.

My point was that the new document created won't have a password -- you
would need to open each of the output documents individually following the
merge and set it.

Cheers


Hi John -

In order for the attachments to be created doesn't the original have to be
"opened" each time? If so it wouldn't be possible for the attachment to be
created since the doc couldn't be "read".

Regards |:>)
Bob Jones
[MVP] Office:Mac

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 
B

Bearded

Saving the doc as a pdf would render it "un-editable" for most users.
And changes would be obvious.

However, that assumes it is going to be an attachment in an Outlook
message for which the address list is a mailmerge.

If the idea is to produce a merged document - ie a single file
combining the p-word protected doc and other content, no can do.

I guess the way to look at is as series of tests:

IS THE PROTECTION from editing a legal / regulatory requirement?

If so, PDF is the best bet - in financial services, for example stock
market announcements, it's standard.

If it is simply a business issue Ð for example the sender wants to be
sure her info is not modified as it goes down the distribution chain -
the alternative could be to place it on a Sharepoint or other location
and email the intended recipients with a pointer or link, accompanied
by a strict warning, if necessary backed by the threat of sanctions.

Or does she want to copy-protect it? In other words prevent the legal
recipients from lifting all or part of it and onpassing, eg by email?

HTH

Ken
 
P

Peter Jamieson

Since it's Word 2003, assuming the e-mail client is Outlook 2003, the
following macro may be enough to meet the specified requirement. Other
clients such as Outlook Express cannot be automated in this way.

If the user is actually using Mac Word I know nothing about the
automatability of the e-mail clients is but assume that Applescripting
the whole thing might be workable in at least some cases.

Sub EmailOneDocPerSourceRecWithBody()
' By Peter Jamieson, 2006
Dim bOutlookStarted As Boolean
Dim bTerminateMerge As Boolean
Dim intSourceRecord As Integer
Dim objMailItem As Outlook.MailItem
Dim objMerge As Word.MailMerge
Dim objOutlook As Outlook.Application
Dim strMailSubject As String
Dim strMailTo As String
Dim strMailBody As String
Dim strOutputDocumentName As String

bOutlookStarted = False
bTerminateMerge = False

' Set up a reference to the
' ActiveDocument, partly because
' the ActiveDocument changes as you
' merge each record

Set objMerge = ActiveDocument.MailMerge

' Start Outlook as necessary

On Error Resume Next
Set objOutlook = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set objOutlook = CreateObject("Outlook.Application")
bOutlookStarted = True
End If

With objMerge

' If no data source has been defined,
' do it here using OpenDataSource.
' But if it is already defined in the
' document, you should not need to
' define it here.

' .OpenDataSource _
' Name:="whatever"

intSourceRecord = 1

Do Until bTerminateMerge
.DataSource.ActiveRecord = intSourceRecord

' if we have gone past the end
' (and possibly, if there are no records)
' then the Activerecord will not be what
' we have just tried to set it to

If .DataSource.ActiveRecord <> intSourceRecord Then
bTerminateMerge = True
' the record exists
Else

' while we are looking at the
' correct activerecord,
' create the mail subject, body and "to"
' Just some sample code here - replace it with
' whatever you need

strMailSubject = _
"Results for " & _
objMerge.DataSource.DataFields("Firstname") & _
" " & objMerge.DataSource.DataFields("Lastname")

strMailBody = _
"Dear " & objMerge.DataSource.DataFields("Firstname") & _
vbCrLf & _
"Please find attached a Word document containing" & vbCrLf & _
"your results for..." & vbCrLf & _
vbCrLf & _
"Yours" & vbCrLf & _
"Your name"
strMailTo = objMerge.DataSource.DataFields("Emailaddress")

' create the document path name
' In this case it can be the same for every recipient,
' but if you want to retain copies of the
' document, you can use info. in the data source

' this is an example - insert your
' own pathname here

strOutputDocumentName = "c:\a\results.doc"

' strOutputDocumentName = _
' "c:\mymergeletters\_" & _
' .DataSource.DataFields("Lastname").Value & _
' " letter.doc"
.DataSource.FirstRecord = intSourceRecord
.DataSource.LastRecord = intSourceRecord
.Destination = wdSendToNewDocument
.Execute

' The Activedocument is always the
' output document

' Add any parameters you need to these calls,
' e.g. here we want to password protect it. This bit is
' untested, and you may need more
ActiveDocument.SaveAs strOutputDocumentName, _
Password:="readpassword", _
WritePassword:="writepassword"
ActiveDocument.Close

' Now create an Outlook Mail Item

Set objMailItem = objOutlook.CreateItem(olMailItem)
With objMailItem
.Subject = strMailSubject
.Body = strMailBody
.To = strMailTo
.Attachments.Add strOutputDocumentName, olByValue, 1
'.Save
.Send
End With
Set objMailItem = Nothing

intSourceRecord = intSourceRecord + 1
End If
Loop
End With

' Close Outlook if appropriate

If bOutlookStarted Then
objOutlook.Quit
End If

Set objOutlook = Nothing
Set objMerge = Nothing

End Sub



Peter Jamieson

http://tips.pjmsn.me.uk
 
J

John McGhie

Hi Ken:

Saving the doc as a pdf would render it "un-editable" for most users.
And changes would be obvious.

Not on a Mac (this is a Mac Word group!). Something like half of all Macs
have the ability to edit PDF. And any PC can acquire the ability for free
in a couple of clicks of the web browser :)

The changes to prices in a quote can be very subtle :)

Cheers

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 

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