View Single Post
  #7   Report Post  
Parisa
 
Posts: n/a
Default

When the user opens the file(s) I want to have the track changes feature
already enabled. I realize most users know how to enable it but my "users"
(attorneys) don't have a clue. Believe me.
Since the below code works perfectly. I wanted add additional code to enable
the track changes (revisions) feature before the file is saved.
I was trying to add it myself but it just doesn't work. Please help.


Sub SplitMergeLetter()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to save each letter created by a
' mailmerge as a separate file.
'
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter Letters
Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
sName = Selection
'set path below
sPath = "C:\MERGELETTERS\"
Docname = sPath & sName
ActiveDocument.Sections.First.Range.Cut

Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=Docname, _
FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
End Sub




"Doug Robbins" wrote:

Exactly what is it that you are trying to do? Where did the track changes
come into it?

--
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
"Parisa" wrote in message
...
I'm not sure if I should start a new thread or if this issue closed. Can
someone direct me please.

Thanks :0)

"Parisa" wrote:

I'm an idiot. I finally figure it out. Thank You . I changed the code
slightly. I removed the index at the end. I have a space at the end but
I'm
trying figure out how to remove the space. I'll figure it out yet.

I recorded the following macro.

With ActiveDocument
.TrackRevisions = True
.PrintRevisions = True
.ShowRevisions = True
End With
End Sub

I tried to incorporate this code into the code below. I added it between
ActiveDocument.Sections.First.Range.Cut and Documents.Add.

ActiveDocument.Sections.First.Range.Cut
ActiveDocument.TrackRevisions = True
ActiveDocument.PrintRevisions = True
ActiveDocument.ShowRevisions = True
Documents.Add

It turned on track changes but it didn't create each new document. What
am I
doing wrong?


Sub SplitMergeLetter()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to save each letter created by a
' mailmerge as a separate file.
'
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter Letters
Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
sName = Selection
'set path below
sPath = "C:\MERGELETTERS\"
Docname = sPath & sName
ActiveDocument.Sections.First.Range.Cut

Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=Docname, _
FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
End Sub



"Graham Mayor" wrote:

See http://www.gmayor.com/installing_macro.htm

As for the code to split a merge using field information, there are a
couple
of possibilities - one would be to insert an extra field (or
combination of
fields to make a single 'word') that provides the (unique!) filename
as the
first thing on the page of the merge document, then run the following
variation on Doug's splitter macro which uses that field or combination
to
name the file then deletes it.

Sub SplitMergeLetter()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to save each letter created by
a
' mailmerge as a separate file.
'
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter Letters
Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
sName = Selection
'set path below
sPath = "D:\My Documents\Test\Merge\"
Docname = sPath & sName & LTrim$(Str$(Counter))
ActiveDocument.Sections.First.Range.Cut
Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=Docname, _
FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
End Sub

You'll find alternative splitting code on my web site.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org





Parisa wrote:
I've been doing a lot of mail merges that require special tweaking
with macros like taking a document and splitting & saving a document
into separate files with the added difficult of having the filename
come from fields within the document. I'm still working on that one.

Anyway, I'm not macro or VB proficient. So far I've borrowed code
from this newsgroup. Are there any sites or books that specialized in
VBA mail merges for newbies? I'm having a tough time understanding
the code I'm borrow from the experts. I need step by step instruction
to begin with.
Thanks