View Single Post
 
Old 05-17-2022, 11:46 PM
elaineAda elaineAda is offline Windows XP Office 2010
Novice
 
Join Date: Mar 2019
Posts: 25
elaineAda is on a distinguished road
Default Macro to save doc into 2 separate files

I have a macro to save the current document in a word document, but i need help to write a macro to at the same time save the last page or the last 2 pages of the current document as either a word document or an excel worksheet. I also need help to export the content of certain content control into excel spreadsheet while saving the file, but I really do not know how to include in this code. Thanks. Any help is appreciated.

Code:
Private Sub CommandButton1_Click()

CommandButton1.Select
Selection.Delete
          

With Application.FileDialog(msoFileDialogSaveAs)
.FilterIndex = 3
.Show

If .SelectedItems.Count <> 0 Then
ActiveDocument.SaveAs2 .SelectedItems(1), wdFormatDocument
End If
End With

End Sub
Reply With Quote