Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-16-2013, 03:28 PM
Cosmo Cosmo is offline Why no 'SaveCopyAs' method? Windows Vista Why no 'SaveCopyAs' method? Office 2007
Competent Performer
Why no 'SaveCopyAs' method?
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default Why no 'SaveCopyAs' method?

I'm working on a document which will need to save 2 versions of itself as a finalized copy and make edits to those documents (including removing the VBA module which is running the 'Finalize' code) while preserving the original document. I have done something similar in PowerPoint, which has a 'Presentation.SaveCopyAs' method, and was hoping to do the same in my Word document. I can only do a 'SaveAs', in which case the current document which is running the code will then be the same as the saved document.



The steps I took in the PowerPoint file were:
1 Verify current document
2 SaveCopy of current document as "FileName_Finalized_1"
3 Open FileName_Finalized_1
4 Remove specific VBA modules, and do any other finalizing steps
5 Close FileName_Finalized_1
6 Repeat steps 2-5 for second version

The only way I can see to do what I want, is to save the current document as the 'Finalized' document, then resave the current document over the original document. This feels kinda hackish, so I thought I'd ask to see if there is a better way to do what I want.
Reply With Quote
  #2  
Old 10-17-2013, 12:05 AM
macropod's Avatar
macropod macropod is offline Why no 'SaveCopyAs' method? Windows 7 32bit Why no 'SaveCopyAs' method? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

First off, Word isn't PowerPoint and the different Office Apps have their own VBA implementations.

If you want to save macro-free documents in Word, simply save them as docx files, using SaveAs.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-17-2013, 05:41 AM
Cosmo Cosmo is offline Why no 'SaveCopyAs' method? Windows Vista Why no 'SaveCopyAs' method? Office 2007
Competent Performer
Why no 'SaveCopyAs' method?
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
First off, Word isn't PowerPoint and the different Office Apps have their own VBA implementations.

If you want to save macro-free documents in Word, simply save them as docx files, using SaveAs.
Thanks for the response. I understand they are not the same, but I was hoping for more consistency for non-application-specific methods. There's nothing about Word that would preclude having a 'Save a Copy' method, so having used it in one office app (both PPT and Excel have that method), I had assumed it would be in another.

Also, I am not trying to save as a macro-free document; the document needs to be saved in a macro-enabled format, but certain modules need to be removed, as well as other changes need to be made to the document (the 2 versions have different changes that need to be made, but need to be made from the original document).

I am guessing that I will need to do what I had originally stated, and save the document into the original filepath after saving the 2 versions, then open each version and make the appropriate edits:

1 Verify current document
2 Save current document as "FileName_Finalized_1"
3 Save current document as "FileName_Finalized_2"
4 Save current document as original filename
5 Open "FileName_Finalized_1"
6 Remove specific VBA modules, and do any other finalizing steps
7 Close FileName_Finalized_1
8 Repeat steps 5-7 for "FileName_Finalized_2"
Reply With Quote
  #4  
Old 10-17-2013, 02:58 PM
fumei fumei is offline Why no 'SaveCopyAs' method? Windows 7 64bit Why no 'SaveCopyAs' method? Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

The main problem issue is the fact you need to have DIFFERENT VBA modules in three different files. I am not sure why that is important, but if it really is, perhaps do this.

1 Verify current document
4 Save current document as original filename
2 Run VBA to remove modules & Saveas "FileName_Finalized_1"
3 Run VBA to remove modules & Saveas "FileName_Finalized_2"

This assumes the removal process is accumulative. If not then you may need to close and reopen original file. And of course you will need to come up with the VBA to edit the code modules.

Last edited by fumei; 10-17-2013 at 09:32 PM.
Reply With Quote
  #5  
Old 10-18-2013, 05:57 AM
Cosmo Cosmo is offline Why no 'SaveCopyAs' method? Windows Vista Why no 'SaveCopyAs' method? Office 2007
Competent Performer
Why no 'SaveCopyAs' method?
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Quote:
Originally Posted by fumei View Post
The main problem issue is the fact you need to have DIFFERENT VBA modules in three different files. I am not sure why that is important, but if it really is, perhaps do this.

1 Verify current document
4 Save current document as original filename
2 Run VBA to remove modules & Saveas "FileName_Finalized_1"
3 Run VBA to remove modules & Saveas "FileName_Finalized_2"

This assumes the removal process is accumulative.
Thanks for the response. Unfortunately, I cannot create document 2 from document 1 (or vice versa; they both require different changes to the content, and need to start from the original master). Currently, the changes to the VBA modules are the same for both, alhough I may also need to save each the documents specifically for version 2003- and 2010+ (doubling the # of documents I would need to create), which would require removing 2010 specific code modules.
Quote:
Originally Posted by fumei View Post
If not then you may need to close and reopen original file. And of course you will need to come up with the VBA to edit the code modules.
This sounds like what I described in my last post (saving the 2 documents, then immediately resaving as the original master document), and I did a quick test which indicates that it should do what I want.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why no 'SaveCopyAs' method? Creating a sorting method. Balliol Word 2 07-25-2013 06:18 AM
Why no 'SaveCopyAs' method? SaveCopyAs tinfanide Excel Programming 2 11-02-2011 06:02 AM
Why no 'SaveCopyAs' method? Shared Contacts & Calendars. Best method crobertson Outlook 1 05-08-2009 05:47 AM
Why no 'SaveCopyAs' method? Method to update saves to all copies aultduell Word 1 11-24-2006 12:50 PM
Retrict Method Condition markp Outlook 0 12-22-2005 05:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:56 PM.


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