Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Karen Jernigan
 
Posts: n/a
Default Double sided merge & duplex print

I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with different
text on the backside. Side 1 has a return address and the recipient address.
Side 2 has dear recipient first name and one or two unique merge fields along
with non-merged text and an image. I'm merging from Excel and each record is
on a single line. The final merged doc needs to be page 1 - the first two
postcards, page 2 - the back side of the first two postcards, page 3 - the
third and fourth postcards, page 4 - the back side of the third and fourth
postcards, etc. I can't get side 2 to populate from Excel. I thought about
just making two docs and print side one then side two on the backside, but I
need to duplex the print job so I can't.

Thanks for the help!
kj
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Double sided merge & duplex print

The following code was put together for someone who wanted to compile a
document by taking alternate pages from separate files. If you were to
execute two separate mail merges to individual documents, you could use this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As Document, Pages
As Integer, Counter As Integer, targetrange As Range 'targetrange added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote in message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with
different
text on the backside. Side 1 has a return address and the recipient
address.
Side 2 has dear recipient first name and one or two unique merge fields
along
with non-merged text and an image. I'm merging from Excel and each record
is
on a single line. The final merged doc needs to be page 1 - the first two
postcards, page 2 - the back side of the first two postcards, page 3 - the
third and fourth postcards, page 4 - the back side of the third and fourth
postcards, etc. I can't get side 2 to populate from Excel. I thought about
just making two docs and print side one then side two on the backside, but
I
need to duplex the print job so I can't.

Thanks for the help!
kj



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Karen Jernigan
 
Posts: n/a
Default Double sided merge & duplex print

Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to compile a
document by taking alternate pages from separate files. If you were to
execute two separate mail merges to individual documents, you could use this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As Document, Pages
As Integer, Counter As Integer, targetrange As Range 'targetrange added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote in message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with
different
text on the backside. Side 1 has a return address and the recipient
address.
Side 2 has dear recipient first name and one or two unique merge fields
along
with non-merged text and an image. I'm merging from Excel and each record
is
on a single line. The final merged doc needs to be page 1 - the first two
postcards, page 2 - the back side of the first two postcards, page 3 - the
third and fourth postcards, page 4 - the back side of the third and fourth
postcards, etc. I can't get side 2 to populate from Excel. I thought about
just making two docs and print side one then side two on the backside, but
I
need to duplex the print job so I can't.

Thanks for the help!
kj




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Double sided merge & duplex print

Execute each merge to a new document, save (I would call one "front" and the
other "back") and close each one, then run the macro and it will ask you to
open each one in turn.

--
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

"Karen Jernigan" wrote in message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to compile a
document by taking alternate pages from separate files. If you were to
execute two separate mail merges to individual documents, you could use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As Document,
Pages
As Integer, Counter As Integer, targetrange As Range 'targetrange added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with
different
text on the backside. Side 1 has a return address and the recipient
address.
Side 2 has dear recipient first name and one or two unique merge fields
along
with non-merged text and an image. I'm merging from Excel and each
record
is
on a single line. The final merged doc needs to be page 1 - the first
two
postcards, page 2 - the back side of the first two postcards, page 3 -
the
third and fourth postcards, page 4 - the back side of the third and
fourth
postcards, etc. I can't get side 2 to populate from Excel. I thought
about
just making two docs and print side one then side two on the backside,
but
I
need to duplex the print job so I can't.

Thanks for the help!
kj






  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Karen Jernigan
 
Posts: n/a
Default Double sided merge & duplex print

I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one "front" and the
other "back") and close each one, then run the macro and it will ask you to
open each one in turn.

--
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

"Karen Jernigan" wrote in message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to compile a
document by taking alternate pages from separate files. If you were to
execute two separate mail merges to individual documents, you could use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As Document,
Pages
As Integer, Counter As Integer, targetrange As Range 'targetrange added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with
different
text on the backside. Side 1 has a return address and the recipient
address.
Side 2 has dear recipient first name and one or two unique merge fields
along
with non-merged text and an image. I'm merging from Excel and each
record
is
on a single line. The final merged doc needs to be page 1 - the first
two
postcards, page 2 - the back side of the first two postcards, page 3 -
the
third and fourth postcards, page 4 - the back side of the third and
fourth
postcards, etc. I can't get side 2 to populate from Excel. I thought
about
just making two docs and print side one then side two on the backside,
but
I
need to duplex the print job so I can't.

Thanks for the help!
kj








  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Double sided merge & duplex print

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

--
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

"Karen Jernigan" wrote in message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one "front" and
the
other "back") and close each one, then run the macro and it will ask you
to
open each one in turn.

--
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

"Karen Jernigan" wrote in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to compile
a
document by taking alternate pages from separate files. If you were
to
execute two separate mail merges to individual documents, you could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As Document,
Pages
As Integer, Counter As Integer, targetrange As Range 'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with
different
text on the backside. Side 1 has a return address and the recipient
address.
Side 2 has dear recipient first name and one or two unique merge
fields
along
with non-merged text and an image. I'm merging from Excel and each
record
is
on a single line. The final merged doc needs to be page 1 - the
first
two
postcards, page 2 - the back side of the first two postcards, page
3 -
the
third and fourth postcards, page 4 - the back side of the third and
fourth
postcards, etc. I can't get side 2 to populate from Excel. I thought
about
just making two docs and print side one then side two on the
backside,
but
I
need to duplex the print job so I can't.

Thanks for the help!
kj








  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Karen Jernigan
 
Posts: n/a
Default Double sided merge & duplex print

Hi Doug,

I followed the instructions and am getting the following error when I try to
run the Macro - Compile Error. Invalid Outside Procedure. Thanks so much for
your help!

Here's how the Macro looks:
Dim sourcea As Document, sourceb As Document, target As Document, Pages As
Integer, Counter As Integer, targetrange As Range 'targetrange added Dim
evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the end of
the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

Sub MergeDocs()
'
' MergeDocs Macro
' Macro created 6/29/2006 by Karen Jernigan
'

End Sub

"Doug Robbins - Word MVP" wrote:

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

--
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

"Karen Jernigan" wrote in message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one "front" and
the
other "back") and close each one, then run the macro and it will ask you
to
open each one in turn.

--
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

"Karen Jernigan" wrote in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to compile
a
document by taking alternate pages from separate files. If you were
to
execute two separate mail merges to individual documents, you could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As Document,
Pages
As Integer, Counter As Integer, targetrange As Range 'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with
different
text on the backside. Side 1 has a return address and the recipient
address.
Side 2 has dear recipient first name and one or two unique merge
fields
along
with non-merged text and an image. I'm merging from Excel and each
record
is
on a single line. The final merged doc needs to be page 1 - the
first
two
postcards, page 2 - the back side of the first two postcards, page
3 -
the
third and fourth postcards, page 4 - the back side of the third and
fourth
postcards, etc. I can't get side 2 to populate from Excel. I thought
about
just making two docs and print side one then side two on the
backside,
but
I
need to duplex the print job so I can't.

Thanks for the help!
kj









  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Double sided merge & duplex print

The code that you have shown needs to be prefaced by Sub Something()

e.g

Sub CombineDocs()

code

End Sub

--
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

"Karen Jernigan" wrote in message
news
Hi Doug,

I followed the instructions and am getting the following error when I try
to
run the Macro - Compile Error. Invalid Outside Procedure. Thanks so much
for
your help!

Here's how the Macro looks:
Dim sourcea As Document, sourceb As Document, target As Document, Pages As
Integer, Counter As Integer, targetrange As Range 'targetrange added Dim
evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the end
of
the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

Sub MergeDocs()
'
' MergeDocs Macro
' Macro created 6/29/2006 by Karen Jernigan
'

End Sub

"Doug Robbins - Word MVP" wrote:

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

--
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

"Karen Jernigan" wrote in
message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one "front"
and
the
other "back") and close each one, then run the macro and it will ask
you
to
open each one in turn.

--
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

"Karen Jernigan" wrote in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to
compile
a
document by taking alternate pages from separate files. If you
were
to
execute two separate mail merges to individual documents, you could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As
Document,
Pages
As Integer, Counter As Integer, targetrange As Range 'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with
different
text on the backside. Side 1 has a return address and the
recipient
address.
Side 2 has dear recipient first name and one or two unique merge
fields
along
with non-merged text and an image. I'm merging from Excel and
each
record
is
on a single line. The final merged doc needs to be page 1 - the
first
two
postcards, page 2 - the back side of the first two postcards,
page
3 -
the
third and fourth postcards, page 4 - the back side of the third
and
fourth
postcards, etc. I can't get side 2 to populate from Excel. I
thought
about
just making two docs and print side one then side two on the
backside,
but
I
need to duplex the print job so I can't.

Thanks for the help!
kj











  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Karen Jernigan
 
Posts: n/a
Default Double sided merge & duplex print

Now I get an error message that it can't find the file. I've never worked
with Macros before so I'm not really sure what to look for.

Here's the Macro string pertaining to the file name.
Set sourcea = Documents.Open(FileName:="...")


"Doug Robbins - Word MVP" wrote:

The code that you have shown needs to be prefaced by Sub Something()

e.g

Sub CombineDocs()

code

End Sub

--
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

"Karen Jernigan" wrote in message
news
Hi Doug,

I followed the instructions and am getting the following error when I try
to
run the Macro - Compile Error. Invalid Outside Procedure. Thanks so much
for
your help!

Here's how the Macro looks:
Dim sourcea As Document, sourceb As Document, target As Document, Pages As
Integer, Counter As Integer, targetrange As Range 'targetrange added Dim
evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the end
of
the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

Sub MergeDocs()
'
' MergeDocs Macro
' Macro created 6/29/2006 by Karen Jernigan
'

End Sub

"Doug Robbins - Word MVP" wrote:

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

--
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

"Karen Jernigan" wrote in
message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one "front"
and
the
other "back") and close each one, then run the macro and it will ask
you
to
open each one in turn.

--
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

"Karen Jernigan" wrote in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to
compile
a
document by taking alternate pages from separate files. If you
were
to
execute two separate mail merges to individual documents, you could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As
Document,
Pages
As Integer, Counter As Integer, targetrange As Range 'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet with
different
text on the backside. Side 1 has a return address and the
recipient
address.
Side 2 has dear recipient first name and one or two unique merge
fields
along
with non-merged text and an image. I'm merging from Excel and
each
record
is
on a single line. The final merged doc needs to be page 1 - the
first
two
postcards, page 2 - the back side of the first two postcards,
page
3 -
the
third and fourth postcards, page 4 - the back side of the third
and
fourth
postcards, etc. I can't get side 2 to populate from Excel. I
thought
about
just making two docs and print side one then side two on the
backside,
but
I
need to duplex the print job so I can't.

Thanks for the help!
kj








  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Double sided merge & duplex print

Inside the " " in place of the ... you need to type the
drive:\path\filename.doc of the document that you created.

Similarly for the Set souceb

--
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

"Karen Jernigan" wrote in message
...
Now I get an error message that it can't find the file. I've never worked
with Macros before so I'm not really sure what to look for.

Here's the Macro string pertaining to the file name.
Set sourcea = Documents.Open(FileName:="...")


"Doug Robbins - Word MVP" wrote:

The code that you have shown needs to be prefaced by Sub Something()

e.g

Sub CombineDocs()

code

End Sub

--
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

"Karen Jernigan" wrote in
message
news
Hi Doug,

I followed the instructions and am getting the following error when I
try
to
run the Macro - Compile Error. Invalid Outside Procedure. Thanks so
much
for
your help!

Here's how the Macro looks:
Dim sourcea As Document, sourceb As Document, target As Document, Pages
As
Integer, Counter As Integer, targetrange As Range 'targetrange added
Dim
evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the
end
of
the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

Sub MergeDocs()
'
' MergeDocs Macro
' Macro created 6/29/2006 by Karen Jernigan
'

End Sub

"Doug Robbins - Word MVP" wrote:

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

--
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

"Karen Jernigan" wrote in
message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one
"front"
and
the
other "back") and close each one, then run the macro and it will
ask
you
to
open each one in turn.

--
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

"Karen Jernigan" wrote in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to
compile
a
document by taking alternate pages from separate files. If you
were
to
execute two separate mail merges to individual documents, you
could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As
Document,
Pages
As Integer, Counter As Integer, targetrange As Range
'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin =
sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing
the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to
start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote
in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet
with
different
text on the backside. Side 1 has a return address and the
recipient
address.
Side 2 has dear recipient first name and one or two unique
merge
fields
along
with non-merged text and an image. I'm merging from Excel and
each
record
is
on a single line. The final merged doc needs to be page 1 -
the
first
two
postcards, page 2 - the back side of the first two postcards,
page
3 -
the
third and fourth postcards, page 4 - the back side of the
third
and
fourth
postcards, etc. I can't get side 2 to populate from Excel. I
thought
about
just making two docs and print side one then side two on the
backside,
but
I
need to duplex the print job so I can't.

Thanks for the help!
kj












  #11   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Karen Jernigan
 
Posts: n/a
Default Double sided merge & duplex print

I fixed the file names and am still getting errors. First I get a small pop
up that says 450 (the number of records) and an OK button. Then both files
launch. When I click the OK button I get the following MS VB popup. Run-time
error '5149': the measurement must be between 0 pt and 1584 pt. I can choose
end, debug or help. End stops the process. Debug takes me to the Macro and
the following line is highlighted: target.PageSetup.LeftMargin =
sourcea.PageSetup.LeftMargin

"Doug Robbins - Word MVP" wrote:

Inside the " " in place of the ... you need to type the
drive:\path\filename.doc of the document that you created.

Similarly for the Set souceb

--
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

"Karen Jernigan" wrote in message
...
Now I get an error message that it can't find the file. I've never worked
with Macros before so I'm not really sure what to look for.

Here's the Macro string pertaining to the file name.
Set sourcea = Documents.Open(FileName:="...")


"Doug Robbins - Word MVP" wrote:

The code that you have shown needs to be prefaced by Sub Something()

e.g

Sub CombineDocs()

code

End Sub

--
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

"Karen Jernigan" wrote in
message
news Hi Doug,

I followed the instructions and am getting the following error when I
try
to
run the Macro - Compile Error. Invalid Outside Procedure. Thanks so
much
for
your help!

Here's how the Macro looks:
Dim sourcea As Document, sourceb As Document, target As Document, Pages
As
Integer, Counter As Integer, targetrange As Range 'targetrange added
Dim
evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the
end
of
the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

Sub MergeDocs()
'
' MergeDocs Macro
' Macro created 6/29/2006 by Karen Jernigan
'

End Sub

"Doug Robbins - Word MVP" wrote:

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

--
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

"Karen Jernigan" wrote in
message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one
"front"
and
the
other "back") and close each one, then run the macro and it will
ask
you
to
open each one in turn.

--
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

"Karen Jernigan" wrote in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to
compile
a
document by taking alternate pages from separate files. If you
were
to
execute two separate mail merges to individual documents, you
could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As
Document,
Pages
As Integer, Counter As Integer, targetrange As Range
'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin =
sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing
the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to
start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan" wrote
in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11 sheet

  #12   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Double sided merge & duplex print

What do you get if you put the command

MsgBox sourcea.PageSetup.LeftMargin

in front of that line of code.

--
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

"Karen Jernigan" wrote in message
news
I fixed the file names and am still getting errors. First I get a small pop
up that says 450 (the number of records) and an OK button. Then both files
launch. When I click the OK button I get the following MS VB popup.
Run-time
error '5149': the measurement must be between 0 pt and 1584 pt. I can
choose
end, debug or help. End stops the process. Debug takes me to the Macro and
the following line is highlighted: target.PageSetup.LeftMargin =
sourcea.PageSetup.LeftMargin

"Doug Robbins - Word MVP" wrote:

Inside the " " in place of the ... you need to type the
drive:\path\filename.doc of the document that you created.

Similarly for the Set souceb

--
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

"Karen Jernigan" wrote in
message
...
Now I get an error message that it can't find the file. I've never
worked
with Macros before so I'm not really sure what to look for.

Here's the Macro string pertaining to the file name.
Set sourcea = Documents.Open(FileName:="...")


"Doug Robbins - Word MVP" wrote:

The code that you have shown needs to be prefaced by Sub Something()

e.g

Sub CombineDocs()

code

End Sub

--
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

"Karen Jernigan" wrote in
message
news Hi Doug,

I followed the instructions and am getting the following error when
I
try
to
run the Macro - Compile Error. Invalid Outside Procedure. Thanks so
much
for
your help!

Here's how the Macro looks:
Dim sourcea As Document, sourceb As Document, target As Document,
Pages
As
Integer, Counter As Integer, targetrange As Range 'targetrange added
Dim
evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the
end
of
the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

Sub MergeDocs()
'
' MergeDocs Macro
' Macro created 6/29/2006 by Karen Jernigan
'

End Sub

"Doug Robbins - Word MVP" wrote:

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

--
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

"Karen Jernigan" wrote in
message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one
"front"
and
the
other "back") and close each one, then run the macro and it will
ask
you
to
open each one in turn.

--
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

"Karen Jernigan" wrote
in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to
compile
a
document by taking alternate pages from separate files. If
you
were
to
execute two separate mail merges to individual documents, you
could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As
Document,
Pages
As Integer, Counter As Integer, targetrange As Range
'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin =
sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin =
sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin =
sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document
containing
the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to
start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage =
ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

--
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

"Karen Jernigan"
wrote
in
message
...
I've been searching for hours and can't figure this out!

I need to layout two unique 4x6 postcards on an 8.5x11
sheet



  #13   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Karen Jernigan
 
Posts: n/a
Default Double sided merge & duplex print

Hi Doug,

I really appreciate your help, but it's just not working and I need to get
this done. How do I contract with you directly?

Thanks,
kj

"Doug Robbins - Word MVP" wrote:

What do you get if you put the command

MsgBox sourcea.PageSetup.LeftMargin

in front of that line of code.

--
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

"Karen Jernigan" wrote in message
news
I fixed the file names and am still getting errors. First I get a small pop
up that says 450 (the number of records) and an OK button. Then both files
launch. When I click the OK button I get the following MS VB popup.
Run-time
error '5149': the measurement must be between 0 pt and 1584 pt. I can
choose
end, debug or help. End stops the process. Debug takes me to the Macro and
the following line is highlighted: target.PageSetup.LeftMargin =
sourcea.PageSetup.LeftMargin

"Doug Robbins - Word MVP" wrote:

Inside the " " in place of the ... you need to type the
drive:\path\filename.doc of the document that you created.

Similarly for the Set souceb

--
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

"Karen Jernigan" wrote in
message
...
Now I get an error message that it can't find the file. I've never
worked
with Macros before so I'm not really sure what to look for.

Here's the Macro string pertaining to the file name.
Set sourcea = Documents.Open(FileName:="...")


"Doug Robbins - Word MVP" wrote:

The code that you have shown needs to be prefaced by Sub Something()

e.g

Sub CombineDocs()

code

End Sub

--
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

"Karen Jernigan" wrote in
message
news Hi Doug,

I followed the instructions and am getting the following error when
I
try
to
run the Macro - Compile Error. Invalid Outside Procedure. Thanks so
much
for
your help!

Here's how the Macro looks:
Dim sourcea As Document, sourceb As Document, target As Document,
Pages
As
Integer, Counter As Integer, targetrange As Range 'targetrange added
Dim
evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the
end
of
the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

Sub MergeDocs()
'
' MergeDocs Macro
' Macro created 6/29/2006 by Karen Jernigan
'

End Sub

"Doug Robbins - Word MVP" wrote:

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

--
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

"Karen Jernigan" wrote in
message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one
"front"
and
the
other "back") and close each one, then run the macro and it will
ask
you
to
open each one in turn.

--
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

"Karen Jernigan" wrote
in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted to
compile
a
document by taking alternate pages from separate files. If
you
were
to
execute two separate mail merges to individual documents, you
could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target As
Document,
Pages
As Integer, Counter As Integer, targetrange As Range
'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin =
sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin =
sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin =
sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document
containing
the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to
start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

  #14   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Double sided merge & duplex print

Karen,

Send the two files to me. You need to remove the uppercase letters
(REMOVETHIS) from my email address.

--
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

"Karen Jernigan" wrote in message
...
Hi Doug,

I really appreciate your help, but it's just not working and I need to get
this done. How do I contract with you directly?

Thanks,
kj

"Doug Robbins - Word MVP" wrote:

What do you get if you put the command

MsgBox sourcea.PageSetup.LeftMargin

in front of that line of code.

--
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

"Karen Jernigan" wrote in
message
news
I fixed the file names and am still getting errors. First I get a small
pop
up that says 450 (the number of records) and an OK button. Then both
files
launch. When I click the OK button I get the following MS VB popup.
Run-time
error '5149': the measurement must be between 0 pt and 1584 pt. I can
choose
end, debug or help. End stops the process. Debug takes me to the Macro
and
the following line is highlighted: target.PageSetup.LeftMargin =
sourcea.PageSetup.LeftMargin

"Doug Robbins - Word MVP" wrote:

Inside the " " in place of the ... you need to type the
drive:\path\filename.doc of the document that you created.

Similarly for the Set souceb

--
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

"Karen Jernigan" wrote in
message
...
Now I get an error message that it can't find the file. I've never
worked
with Macros before so I'm not really sure what to look for.

Here's the Macro string pertaining to the file name.
Set sourcea = Documents.Open(FileName:="...")


"Doug Robbins - Word MVP" wrote:

The code that you have shown needs to be prefaced by Sub
Something()

e.g

Sub CombineDocs()

code

End Sub

--
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

"Karen Jernigan" wrote in
message
news Hi Doug,

I followed the instructions and am getting the following error
when
I
try
to
run the Macro - Compile Error. Invalid Outside Procedure. Thanks
so
much
for
your help!

Here's how the Macro looks:
Dim sourcea As Document, sourceb As Document, target As Document,
Pages
As
Integer, Counter As Integer, targetrange As Range 'targetrange
added
Dim
evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document containing the even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from
the
end
of
the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

Sub MergeDocs()
'
' MergeDocs Macro
' Macro created 6/29/2006 by Karen Jernigan
'

End Sub

"Doug Robbins - Word MVP" wrote:

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

--
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

"Karen Jernigan" wrote
in
message
...
I'm afraid I don't know where to begin to run the macro.

"Doug Robbins - Word MVP" wrote:

Execute each merge to a new document, save (I would call one
"front"
and
the
other "back") and close each one, then run the macro and it
will
ask
you
to
open each one in turn.

--
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

"Karen Jernigan"
wrote
in
message
...
Thanks, Doug! From where do I begin this process?

"Doug Robbins - Word MVP" wrote:

The following code was put together for someone who wanted
to
compile
a
document by taking alternate pages from separate files.
If
you
were
to
execute two separate mail merges to individual documents,
you
could
use
this
code to then combine them into one.

Dim sourcea As Document, sourceb As Document, target
As
Document,
Pages
As Integer, Counter As Integer, targetrange As Range
'targetrange
added

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages =
ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

Set sourceb = Documents.Open(FileName:="...")

Set target = Documents.Add

target.PageSetup.LeftMargin =
sourcea.PageSetup.LeftMargin

target.PageSetup.RightMargin =
sourcea.PageSetup.RightMargin

target.PageSetup.TopMargin =
sourcea.PageSetup.TopMargin

target.PageSetup.BottomMargin =
sourcea.PageSetup.BottomMargin

target.AcceptAllRevisions

Counter = 0

While Counter Pages

sourcea.Activate

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

ActiveDocument.Bookmarks("\page").Range.Cut

sourceb.Activate 'Assumed to be the document
containing
the
even
pages

Selection.EndKey Unit:=wdStory 'Line of code added
to
start
from
the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing double sided Rouke Bakker Page Layout 1 November 1st 05 02:46 AM
Print Blank Lines Merge MusicMarth Mailmerge 2 January 7th 05 06:37 PM
Is there any way to print double sided from a word document? I.E.. Chad5770 Microsoft Word Help 1 December 30th 04 08:18 PM
How can I print 3 merge documents per page? TML - Boone Mailmerge 1 December 11th 04 10:11 PM
How can you print all documents in a mail merge? BLJ Mailmerge 1 December 9th 04 06:16 PM


All times are GMT +1. The time now is 07:36 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"