![]() |
#1
|
|||
|
|||
![]()
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. |
#2
|
||||
|
||||
![]()
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] |
#3
|
|||
|
|||
![]() Quote:
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" |
#4
|
|||
|
|||
![]()
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. |
#5
|
|||
|
|||
![]() Quote:
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. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Balliol | Word | 2 | 07-25-2013 06:18 AM |
![]() |
tinfanide | Excel Programming | 2 | 11-02-2011 06:02 AM |
![]() |
crobertson | Outlook | 1 | 05-08-2009 05:47 AM |
![]() |
aultduell | Word | 1 | 11-24-2006 12:50 PM |
Retrict Method Condition | markp | Outlook | 0 | 12-22-2005 05:38 PM |