A
alisam
This macro has been generously given to me by Doug Robbins MVP in this
discussion group and I have added to it. Instead of using the MsgBox, how do
I immediately get the macro to open the document (that it just saved)? The
reason I wish to do this is so that I can e-mail the word document using the
Send to Mail Recipient (as Attachment) button.
Sub Release_Client()
Dim Source As Document, Target As Document
Dim fname As String
Dim arange As Range
Dim amsg As String
Set Source = ActiveDocument
With Source
fname = "C:\Release Notes\Client\" & .FormFields("Client_Task").Result &
"_" & .FormFields("Client_Code").Result
Set arange = .Sections(11).Range
arange.End = .Sections(12).Range.End
End With
Set Target = Documents.Add
With Target
.Range.FormattedText = arange.FormattedText
.Range.Fields.Unlink
.SaveAs fname
.Close
amsg = "Client Release Notes have been saved in C:\Release Notes\Client\"
MsgBox amsg
End With
End Sub
discussion group and I have added to it. Instead of using the MsgBox, how do
I immediately get the macro to open the document (that it just saved)? The
reason I wish to do this is so that I can e-mail the word document using the
Send to Mail Recipient (as Attachment) button.
Sub Release_Client()
Dim Source As Document, Target As Document
Dim fname As String
Dim arange As Range
Dim amsg As String
Set Source = ActiveDocument
With Source
fname = "C:\Release Notes\Client\" & .FormFields("Client_Task").Result &
"_" & .FormFields("Client_Code").Result
Set arange = .Sections(11).Range
arange.End = .Sections(12).Range.End
End With
Set Target = Documents.Add
With Target
.Range.FormattedText = arange.FormattedText
.Range.Fields.Unlink
.SaveAs fname
.Close
amsg = "Client Release Notes have been saved in C:\Release Notes\Client\"
MsgBox amsg
End With
End Sub