Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / November 2005

Tip: Looking for answers? Try searching our database.

Protect Documents After Merge?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Antonimo - 24 Oct 2003 15:08 GMT
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.

------------------------------------------------
Doug Robbins - Word MVP - 25 Oct 2003 09:20 GMT
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
> 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.
[quoted text clipped - 11 lines]
>
> ~~ View and post usenet messages directly from
http://www.MSAccessForum.com/
Gaya3 - 28 Nov 2005 07:41 GMT
Hi Dough,

I would want to on a similar issue: What i want to achieve is execute
mailmerge on a redirected document and then read the entire contents so that
later i can use the text (to be displayed in a UI form).

sample segment 1:

ActiveDocument.MailMerge.Destination = wdSendToNewDocument
ActiveDocument.MailMerge.Execute

would create a new doc eg: Letters1.doc under MyDocuments folder and i then
saved it under a path (eg -C:\Temp\Test.doc)and

Documents(path).Range.Text would return the merged text -- with all the
contacts & the template.

I had also created a new Word.Document object

Dim wrdDataDoc As Word.Document
and at --
wrdDataDoc.MailMerge.Execute

it complains of method/property not supported.

My requirement -- To be able bypass the explicit saving of the new merged
word doc that gets created and then be able to read the merged information or
if can redirect the merge to a new doc and then do the same?

Thanks,
Gaya3

>Hi Antonimo,
>
[quoted text clipped - 53 lines]
>> ~~ View and post usenet messages directly from
>http://www.MSAccessForum.com/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.