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/