View Single Post
 
Old 04-22-2013, 05:26 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 JennEx,

With your Merge2 sub, change:
Code:
If Worksheets("varhold").Range("V1") = "Edit" Then
  .Destination = wdSendtToNewDocument
Else
  .Destination = wdSendToPrinter
End If
to:
.Destination = wdSendtToNewDocument
and change:
Code:
myPath = "u:\Sports13\Workorders\" & Format(Worksheets("varhold").Range("A1"), "ddd dd-mmm-yy")
    If Len(Dir(myPath, vbDirectory)) = 0 Then MkDir myPath
    oDoc2.SaveAs myPath & "\" & (Worksheets("varhold").Range("A46").Value & "docx")
to:
Code:
    With oDoc2
      If Worksheets("varhold").Range("V1") = "Edit" Then
        myPath = "u:\Sports13\Workorders\" & Format(Worksheets("varhold").Range("A1"), "ddd dd-mmm-yy")
        If Len(Dir(myPath, vbDirectory)) = 0 Then MkDir myPath
      .SaveAs myPath & "\" & (Worksheets("varhold").Range("A46").Value & "docx")
      Else
        .PrintOut
      End If
      .Close False
    End With
Regarding the looping issue, I think I'd need to see the code that calls the proceed23 and Merge2 subs before I could address it.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote