This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C83365.540730D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I have a macro in Word that I want to move to my MSAccess app and run =
from MSAccess. It merges a form file with a data file to a new screen, =
then prints and exits:

Application.ScreenUpdating =3D False

=20

Documents.Open FileName:=3D"K:\legalper\mergform.doc", =
ConfirmConversions:=3D _

False, ReadOnly:=3DFalse, AddToRecentFiles:=3DFalse, =
PasswordDocument:=3D"", _

PasswordTemplate:=3D"", Revert:=3DFalse, =
WritePasswordDocument:=3D"", _

WritePasswordTemplate:=3D"", Format:=3DwdOpenFormatAuto

With ActiveDocument.MailMerge

.Destination =3D wdSendToNewDocument

.Execute

End With



' PRINT AND EXIT



Application.PrintOut FileName:=3D"", =
Range:=3DwdPrintAllDocument, Item:=3D _

wdPrintDocumentContent, Copies:=3D1, Pages:=3D"", =
PageType:=3DwdPrintAllPages, _

ManualDuplexPrint:=3DFalse, Collate:=3DTrue, =
Background:=3DFalse, PrintToFile:=3D _

False, PrintZoomColumn:=3D0, PrintZoomRow:=3D0, =
PrintZoomPaperWidth:=3D0, _

PrintZoomPaperHeight:=3D0

ActiveDocument.Close SaveChanges:=3DwdDoNotSaveChanges

Application.Quit SaveChanges:=3DwdDoNotSaveChanges =20

Thanks to RM, I have successfully revised as follows, but it's jamming =
with my Application.PrintOut options in bold below:



Public Function Env()

Dim wd As Object
Dim wdActiveDoc As Object 'RM: Added this to help ensure that you're
'working on the document you intend to.
Dim wdField As Object 'RM: Note the change in name here to avoid
'ambiguity with the Field object in both Word =
and
'Access. As well, I changed the type, since
'(like Word.Application), you have to use late
'binding.
=20
Set wd =3D CreateObject("Word.Application")
wd.Visible =3D True

wd.Application.ScreenUpdating =3D False
=20
Set wdActiveDoc =3D wd.Documents.Open("K:\legalper\mergform.doc", =
False, False, _
False, "", "", False, "", "", 0)
=20
With wdActiveDoc.MailMerge
.Destination =3D 0
.Execute
End With
wd.Windows("mergform.doc").Activate
wd.ActiveWindow.Close 0



' PRINT AND EXIT: PLEASE HELP ME HERE:



wd.Application.PrintOut =3D "", 0, 0, 1, "", 0, False, True, =
False, _
False, 0, 0, 0, 0

------=_NextPart_000_0006_01C83365.540730D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16544" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><STRONG>I have a macro in Word that I =
want to move=20
to my MSAccess app and run from MSAccess. It merges a form file with a =
data file=20
to a new screen, then prints and exits:</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2>Application.ScreenUpdating =3D False</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><?xml:namespace =
prefix =3D o ns=20
=3D "urn:schemas-microsoft-com:office:office" /><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>Documents.Open FileName:=3D"K:\legalper\mergform.doc",=20
ConfirmConversions:=3D _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>False, ReadOnly:=3DFalse, AddToRecentFiles:=3DFalse,=20
PasswordDocument:=3D"", _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>PasswordTemplate:=3D"", Revert:=3DFalse, =
WritePasswordDocument:=3D"",=20
_</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>WritePasswordTemplate:=3D"", =
Format:=3DwdOpenFormatAuto</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>With=20
ActiveDocument.MailMerge</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>.Destination =3D wdSendToNewDocument</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>.Execute</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>End=20
With</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>' PRINT AND=20
EXIT</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>Application.PrintOut FileName:=3D"", =
Range:=3DwdPrintAllDocument, Item:=3D=20
_</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>wdPrintDocumentContent, Copies:=3D1, Pages:=3D"",=20
PageType:=3DwdPrintAllPages, _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>ManualDuplexPrint:=3DFalse, Collate:=3DTrue, =
Background:=3DFalse,=20
PrintToFile:=3D _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>False, PrintZoomColumn:=3D0, PrintZoomRow:=3D0, =
PrintZoomPaperWidth:=3D0,=20
_</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>PrintZoomPaperHeight:=3D0</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>ActiveDocument.Close=20
SaveChanges:=3DwdDoNotSaveChanges</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>Application.Quit SaveChanges:=3DwdDoNotSaveChanges<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN></FONT></FONT></P></BLOCKQUOTE></BLOCKQUOTE>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2><STRONG>&nbsp;Thanks to RM, I have successfully revised as =
follows, but=20
it's jamming with my Application.PrintOut options in bold=20
below:</STRONG></FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>Public Function Env()</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; Dim wd As Object<BR>&nbsp;&nbsp;&nbsp; Dim =
wdActiveDoc=20
As Object 'RM: Added this to help ensure that=20
you're<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
'working on the document you intend to.<BR>&nbsp;&nbsp;&nbsp; Dim =
wdField As=20
Object 'RM: Note the change in name here to=20
avoid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
'ambiguity with the Field object in both Word=20
and<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
'Access.&nbsp; As well, I changed the type,=20
since<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
'(like Word.Application), you have to use=20
late<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
'binding.<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set wd =3D=20
CreateObject("Word.Application")<BR>&nbsp;&nbsp;&nbsp; wd.Visible =3D=20
True</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; wd.Application.ScreenUpdating =3D=20
False<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; Set wdActiveDoc =3D=20
wd.Documents.Open("K:\legalper\mergform.doc", False, False,=20
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
False, "", "", False, "", "", 0)<BR>&nbsp;&nbsp;&nbsp; =
<BR>&nbsp;&nbsp;&nbsp;=20
With wdActiveDoc.MailMerge<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

.Destination =3D 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Execute<BR>&nbsp;&nbsp;&nbsp; End With<BR>&nbsp;&nbsp;&nbsp;=20
wd.Windows("mergform.doc").Activate<BR>&nbsp;&nbsp;&nbsp; =
wd.ActiveWindow.Close=20
0</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; ' PRINT AND EXIT: <STRONG>PLEASE HELP ME=20
HERE:</STRONG></FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;<STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
wd.Application.PrintOut =3D "", 0, 0, 1, "", 0, False, True, False,=20
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; False, 0, 0, 0,=20
0</STRONG></FONT></o:p></P></DIV></BODY></HTML>

------=_NextPart_000_0006_01C83365.540730D0--

Re: Moving code from MSWord to MSAccess by Doug

Doug
Fri Nov 30 22:27:50 PST 2007

This is a multi-part message in MIME format.

------=_NextPart_000_001C_01C83437.1D9C3040
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Replace=20

With wdActiveDoc.MailMerge
.Destination =3D 0
.Execute
End With
wd.Windows("mergform.doc").Activate
wd.ActiveWindow.Close 0
=20

with



With wdActiveDoc.MailMerge
.Destination =3D 0
.Execute
End With

wd.ActiveDocument.PrintOut Background: =3D False
wd.Windows("mergform.doc").Activate
wd.ActiveWindow.Close 0

=20


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

"Kathy Webster" <slickdock@yahoo.com> wrote in message =
news:47509c33$0$16470$4c368faf@roadrunner.com...
I have a macro in Word that I want to move to my MSAccess app and run =
from MSAccess. It merges a form file with a data file to a new screen, =
then prints and exits:

Application.ScreenUpdating =3D False

=20

Documents.Open FileName:=3D"K:\legalper\mergform.doc", =
ConfirmConversions:=3D _

False, ReadOnly:=3DFalse, AddToRecentFiles:=3DFalse, =
PasswordDocument:=3D"", _

PasswordTemplate:=3D"", Revert:=3DFalse, =
WritePasswordDocument:=3D"", _

WritePasswordTemplate:=3D"", Format:=3DwdOpenFormatAuto

With ActiveDocument.MailMerge

.Destination =3D wdSendToNewDocument

.Execute

End With



' PRINT AND EXIT



Application.PrintOut FileName:=3D"", =
Range:=3DwdPrintAllDocument, Item:=3D _

wdPrintDocumentContent, Copies:=3D1, Pages:=3D"", =
PageType:=3DwdPrintAllPages, _

ManualDuplexPrint:=3DFalse, Collate:=3DTrue, =
Background:=3DFalse, PrintToFile:=3D _

False, PrintZoomColumn:=3D0, PrintZoomRow:=3D0, =
PrintZoomPaperWidth:=3D0, _

PrintZoomPaperHeight:=3D0

ActiveDocument.Close SaveChanges:=3DwdDoNotSaveChanges

Application.Quit SaveChanges:=3DwdDoNotSaveChanges =20

Thanks to RM, I have successfully revised as follows, but it's =
jamming with my Application.PrintOut options in bold below:

=20

Public Function Env()

Dim wd As Object
Dim wdActiveDoc As Object 'RM: Added this to help ensure that =
you're
'working on the document you intend to.
Dim wdField As Object 'RM: Note the change in name here to avoid
'ambiguity with the Field object in both =
Word and
'Access. As well, I changed the type, since
'(like Word.Application), you have to use =
late
'binding.
=20
Set wd =3D CreateObject("Word.Application")
wd.Visible =3D True

wd.Application.ScreenUpdating =3D False
=20
Set wdActiveDoc =3D wd.Documents.Open("K:\legalper\mergform.doc", =
False, False, _
False, "", "", False, "", "", 0)
=20
With wdActiveDoc.MailMerge
.Destination =3D 0
.Execute
End With
wd.Windows("mergform.doc").Activate
wd.ActiveWindow.Close 0

=20

' PRINT AND EXIT: PLEASE HELP ME HERE:

=20

wd.Application.PrintOut =3D "", 0, 0, 1, "", 0, False, True, =
False, _
False, 0, 0, 0, 0

------=_NextPart_000_001C_01C83437.1D9C3040
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16544" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Replace </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; With=20
wdActiveDoc.MailMerge<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
.Destination=20
=3D 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
.Execute<BR>&nbsp;&nbsp;&nbsp;=20
End With<BR>&nbsp;&nbsp;&nbsp;=20
wd.Windows("mergform.doc").Activate<BR>&nbsp;&nbsp;&nbsp; =
wd.ActiveWindow.Close=20
0</FONT>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2>with</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp; With=20
wdActiveDoc.MailMerge<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
.Destination=20
=3D 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
.Execute<BR>&nbsp;&nbsp;&nbsp;=20
End With</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; wd.ActiveDocument.PrintOut Background: =3D=20
False<BR>&nbsp;&nbsp;&nbsp;=20
wd.Windows("mergform.doc").Activate<BR>&nbsp;&nbsp;&nbsp; =
wd.ActiveWindow.Close=20
0</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt"><o:p></o:p>&nbsp;</P></DIV>
<DIV><BR>-- <BR>Hope this helps.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Please reply to the newsgroup unless you wish to avail yourself of=20
my<BR>services on a paid consulting basis.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Doug Robbins - Word MVP<BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Kathy Webster" &lt;<A=20
href=3D"mailto:slickdock@yahoo.com">slickdock@yahoo.com</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:47509c33$0$16470$4c368faf@roadrunner.com">news:47509c33$0$16=
470$4c368faf@roadrunner.com</A>...</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>I have a macro in Word that I =
want to=20
move to my MSAccess app and run from MSAccess. It merges a form file =
with a=20
data file to a new screen, then prints and =
exits:</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2>Application.ScreenUpdating =3D False</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>Documents.Open FileName:=3D"K:\legalper\mergform.doc",=20
ConfirmConversions:=3D _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>False, ReadOnly:=3DFalse, AddToRecentFiles:=3DFalse,=20
PasswordDocument:=3D"", _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>PasswordTemplate:=3D"", Revert:=3DFalse, =
WritePasswordDocument:=3D"",=20
_</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>WritePasswordTemplate:=3D"",=20
Format:=3DwdOpenFormatAuto</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>With=20
ActiveDocument.MailMerge</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>.Destination =3D wdSendToNewDocument</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>.Execute</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>End=20
With</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>' PRINT=20
AND EXIT</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>Application.PrintOut FileName:=3D"", =
Range:=3DwdPrintAllDocument,=20
Item:=3D _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>wdPrintDocumentContent, Copies:=3D1, Pages:=3D"",=20
PageType:=3DwdPrintAllPages, _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>ManualDuplexPrint:=3DFalse, Collate:=3DTrue, =
Background:=3DFalse,=20
PrintToFile:=3D _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>False, PrintZoomColumn:=3D0, PrintZoomRow:=3D0, =
PrintZoomPaperWidth:=3D0,=20
_</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>PrintZoomPaperHeight:=3D0</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>ActiveDocument.Close=20
SaveChanges:=3DwdDoNotSaveChanges</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>Application.Quit SaveChanges:=3DwdDoNotSaveChanges<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN></FONT></FONT></P></BLOCKQUOTE></BLOCKQUOTE>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2><STRONG>&nbsp;Thanks to RM, I have successfully revised as =
follows, but=20
it's jamming with my Application.PrintOut options in bold=20
below:</STRONG></FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>Public Function Env()</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; Dim wd As Object<BR>&nbsp;&nbsp;&nbsp; Dim =

wdActiveDoc As Object 'RM: Added this to help ensure that=20
=
you're<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
'working on the document you intend to.<BR>&nbsp;&nbsp;&nbsp; Dim =
wdField As=20
Object 'RM: Note the change in name here to=20
=
avoid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
'ambiguity with the Field object in both Word=20
=
and<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
'Access.&nbsp; As well, I changed the type,=20
=
since<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
'(like Word.Application), you have to use=20
=
late<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
'binding.<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set wd =3D=20
CreateObject("Word.Application")<BR>&nbsp;&nbsp;&nbsp; wd.Visible =3D=20
True</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; wd.Application.ScreenUpdating =3D=20
False<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; Set wdActiveDoc =3D=20
wd.Documents.Open("K:\legalper\mergform.doc", False, False,=20
=
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
False, "", "", False, "", "", 0)<BR>&nbsp;&nbsp;&nbsp; =
<BR>&nbsp;&nbsp;&nbsp;=20
With =
wdActiveDoc.MailMerge<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Destination =3D 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Execute<BR>&nbsp;&nbsp;&nbsp; End With<BR>&nbsp;&nbsp;&nbsp;=20
wd.Windows("mergform.doc").Activate<BR>&nbsp;&nbsp;&nbsp;=20
wd.ActiveWindow.Close 0</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; ' PRINT AND EXIT: <STRONG>PLEASE HELP ME=20
HERE:</STRONG></FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;<STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
wd.Application.PrintOut =3D "", 0, 0, 1, "", 0, False, True, False,=20
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; False, 0, 0, 0,=20
0</STRONG></FONT></o:p></P></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_001C_01C83437.1D9C3040--


Re: Moving code from MSWord to MSAccess by Kathy

Kathy
Mon Dec 03 09:45:37 PST 2007

This is a multi-part message in MIME format.

------=_NextPart_000_0014_01C83591.420764D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Beautiful. Thank you.
"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> wrote in message =
news:eEgVTN%23MIHA.4196@TK2MSFTNGP04.phx.gbl...
Replace=20

With wdActiveDoc.MailMerge
.Destination =3D 0
.Execute
End With
wd.Windows("mergform.doc").Activate
wd.ActiveWindow.Close 0=20
=20

with



With wdActiveDoc.MailMerge
.Destination =3D 0
.Execute
End With

wd.ActiveDocument.PrintOut Background: =3D False
wd.Windows("mergform.doc").Activate
wd.ActiveWindow.Close 0

=20


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

"Kathy Webster" <slickdock@yahoo.com> wrote in message =
news:47509c33$0$16470$4c368faf@roadrunner.com...
I have a macro in Word that I want to move to my MSAccess app and =
run from MSAccess. It merges a form file with a data file to a new =
screen, then prints and exits:

Application.ScreenUpdating =3D False

=20

Documents.Open FileName:=3D"K:\legalper\mergform.doc", =
ConfirmConversions:=3D _

False, ReadOnly:=3DFalse, AddToRecentFiles:=3DFalse, =
PasswordDocument:=3D"", _

PasswordTemplate:=3D"", Revert:=3DFalse, =
WritePasswordDocument:=3D"", _

WritePasswordTemplate:=3D"", Format:=3DwdOpenFormatAuto

With ActiveDocument.MailMerge

.Destination =3D wdSendToNewDocument

.Execute

End With



' PRINT AND EXIT



Application.PrintOut FileName:=3D"", =
Range:=3DwdPrintAllDocument, Item:=3D _

wdPrintDocumentContent, Copies:=3D1, Pages:=3D"", =
PageType:=3DwdPrintAllPages, _

ManualDuplexPrint:=3DFalse, Collate:=3DTrue, =
Background:=3DFalse, PrintToFile:=3D _

False, PrintZoomColumn:=3D0, PrintZoomRow:=3D0, =
PrintZoomPaperWidth:=3D0, _

PrintZoomPaperHeight:=3D0

ActiveDocument.Close SaveChanges:=3DwdDoNotSaveChanges

Application.Quit SaveChanges:=3DwdDoNotSaveChanges =20

Thanks to RM, I have successfully revised as follows, but it's =
jamming with my Application.PrintOut options in bold below:

=20

Public Function Env()

Dim wd As Object
Dim wdActiveDoc As Object 'RM: Added this to help ensure that =
you're
'working on the document you intend =
to.
Dim wdField As Object 'RM: Note the change in name here to avoid
'ambiguity with the Field object in both =
Word and
'Access. As well, I changed the type, =
since
'(like Word.Application), you have to use =
late
'binding.
=20
Set wd =3D CreateObject("Word.Application")
wd.Visible =3D True

wd.Application.ScreenUpdating =3D False
=20
Set wdActiveDoc =3D =
wd.Documents.Open("K:\legalper\mergform.doc", False, False, _
False, "", "", False, "", "", 0)
=20
With wdActiveDoc.MailMerge
.Destination =3D 0
.Execute
End With
wd.Windows("mergform.doc").Activate
wd.ActiveWindow.Close 0

=20

' PRINT AND EXIT: PLEASE HELP ME HERE:

=20

wd.Application.PrintOut =3D "", 0, 0, 1, "", 0, False, True, =
False, _
False, 0, 0, 0, 0

------=_NextPart_000_0014_01C83591.420764D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16544" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Beautiful. Thank you.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Doug Robbins - Word MVP" &lt;<A=20
href=3D"mailto:dkr@REMOVECAPSmvps.org">dkr@REMOVECAPSmvps.org</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:eEgVTN%23MIHA.4196@TK2MSFTNGP04.phx.gbl">news:eEgVTN%23MIHA.=
4196@TK2MSFTNGP04.phx.gbl</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Replace </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; With=20
wdActiveDoc.MailMerge<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Destination =3D 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Execute<BR>&nbsp;&nbsp;&nbsp; End With<BR>&nbsp;&nbsp;&nbsp;=20
wd.Windows("mergform.doc").Activate<BR>&nbsp;&nbsp;&nbsp;=20
wd.ActiveWindow.Close 0</FONT>=20
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt"><o:p></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2>with</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp; With=20
wdActiveDoc.MailMerge<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Destination =3D 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Execute<BR>&nbsp;&nbsp;&nbsp; End With</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; wd.ActiveDocument.PrintOut Background: =3D =

False<BR>&nbsp;&nbsp;&nbsp;=20
wd.Windows("mergform.doc").Activate<BR>&nbsp;&nbsp;&nbsp;=20
wd.ActiveWindow.Close 0</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt"><o:p></o:p>&nbsp;</P></DIV>
<DIV><BR>-- <BR>Hope this helps.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Please reply to the newsgroup unless you wish to avail yourself =
of=20
my<BR>services on a paid consulting basis.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Doug Robbins - Word MVP<BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Kathy Webster" &lt;<A=20
href=3D"mailto:slickdock@yahoo.com">slickdock@yahoo.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:47509c33$0$16470$4c368faf@roadrunner.com">news:47509c33$0$16=
470$4c368faf@roadrunner.com</A>...</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>I have a macro in Word that =
I want to=20
move to my MSAccess app and run from MSAccess. It merges a form file =
with a=20
data file to a new screen, then prints and =
exits:</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2>Application.ScreenUpdating =3D False</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>Documents.Open FileName:=3D"K:\legalper\mergform.doc",=20
ConfirmConversions:=3D _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>False, ReadOnly:=3DFalse, AddToRecentFiles:=3DFalse,=20
PasswordDocument:=3D"", _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>PasswordTemplate:=3D"", Revert:=3DFalse, =
WritePasswordDocument:=3D"",=20
_</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>WritePasswordTemplate:=3D"",=20
Format:=3DwdOpenFormatAuto</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>With=20
ActiveDocument.MailMerge</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

</SPAN>.Destination =3D wdSendToNewDocument</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>.Execute</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>End=20
With</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>' PRINT=20
AND EXIT</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>Application.PrintOut FileName:=3D"", =
Range:=3DwdPrintAllDocument,=20
Item:=3D _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>wdPrintDocumentContent, Copies:=3D1, Pages:=3D"",=20
PageType:=3DwdPrintAllPages, _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>ManualDuplexPrint:=3DFalse, Collate:=3DTrue, =
Background:=3DFalse,=20
PrintToFile:=3D _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>False, PrintZoomColumn:=3D0, PrintZoomRow:=3D0,=20
PrintZoomPaperWidth:=3D0, _</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>PrintZoomPaperHeight:=3D0</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>ActiveDocument.Close=20
SaveChanges:=3DwdDoNotSaveChanges</FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>Application.Quit SaveChanges:=3DwdDoNotSaveChanges<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN></FONT></FONT></P></BLOCKQUOTE></BLOCKQUOTE>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2><STRONG>&nbsp;Thanks to RM, I have successfully revised as =
follows,=20
but it's jamming with my Application.PrintOut options in bold=20
below:</STRONG></FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>Public Function Env()</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; Dim wd As Object<BR>&nbsp;&nbsp;&nbsp; =
Dim=20
wdActiveDoc As Object 'RM: Added this to help ensure that=20
=
you're<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
'working on the document you intend to.<BR>&nbsp;&nbsp;&nbsp; Dim =
wdField As=20
Object 'RM: Note the change in name here to=20
=
avoid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
'ambiguity with the Field object in both Word=20
=
and<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
'Access.&nbsp; As well, I changed the type,=20
=
since<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
'(like Word.Application), you have to use=20
=
late<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
'binding.<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set wd =3D=20
CreateObject("Word.Application")<BR>&nbsp;&nbsp;&nbsp; wd.Visible =
=3D=20
True</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; wd.Application.ScreenUpdating =3D=20
False<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; Set wdActiveDoc =3D=20
wd.Documents.Open("K:\legalper\mergform.doc", False, False,=20
=
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
False, "", "", False, "", "", 0)<BR>&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp; With=20
wdActiveDoc.MailMerge<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Destination =3D 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
.Execute<BR>&nbsp;&nbsp;&nbsp; End With<BR>&nbsp;&nbsp;&nbsp;=20
wd.Windows("mergform.doc").Activate<BR>&nbsp;&nbsp;&nbsp;=20
wd.ActiveWindow.Close 0</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; ' PRINT AND EXIT: <STRONG>PLEASE HELP ME =

HERE:</STRONG></FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;<STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
wd.Application.PrintOut =3D "", 0, 0, 1, "", 0, False, True, False,=20
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; False, 0, 0, 0,=20
=
0</STRONG></FONT></o:p></P></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>=


------=_NextPart_000_0014_01C83591.420764D0--