Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-17-2022, 11:46 PM
elaineAda elaineAda is offline Macro to save doc into 2 separate files Windows XP Macro to save doc into 2 separate files Office 2010
Novice
Macro to save doc into 2 separate files
 
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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to save doc into 2 separate files Microsoft Word VBA to save Word doc to separate PDF files using a Mail Merge field as File name meghanquint4 Word VBA 2 02-28-2018 07:12 AM
Having Issues Applying a Macro Across Multiple Files. Changes Just Don't Seem To Save. Kajex Word VBA 2 09-08-2017 06:37 AM
Macro to save doc into 2 separate files Tweak Macro to Save Each Page of Word Document as Separate PDF or Doc File? Hewg74 Word VBA 3 08-22-2016 05:20 PM
Macro to save doc into 2 separate files Can I use the filter function to separate letters into separate files? drhauser Mail Merge 2 12-14-2011 02:18 PM
Any easy way to separate a Word document into separate files? SamHelm Word 0 08-21-2010 05:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft