View Single Post
 
Old 05-24-2016, 11:48 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote