Hi Jenn,
I'd suggest:
ByVal dest as Long
and, instead of:
conditionally changing the destination, always use:
wdSendtToNewDocument
Also, instead of:
With .ActiveDocument
...
End With
Set oDoc2 = objWord.ActiveDocument
'MsgBox oDoc2.Name
With oDoc2
...
End with
use:
Set oDoc2 = objWord.ActiveDocument
With oDoc2
...
End with
and, where you have:
.SaveAs myPath & "\" & rpt_od & ".docx"
introduce the dest test at this point to conditionally save (via SaveAs) or print (via .Printout) the document, then close it without saving.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|