Results 1 to 2 of 2
2016-10-09, 01:45 #1
Word SaveAs current Filename+suffix
I customize file1.docx with a macro, and want it to SaveAs file1-a.docx;
Then I reopen file1, customize differently with another macro, and want SaveAs file1-b.docx;
Repeat 3-4 more times to end up with file1-c.docx, file1-d.docx, file1-e.docx, file1-f.docx
There are over 100 fileX to deal with, so the 'file1' part can't be hardcoded, it must call the current file's name.
The suffixes [-a, -b, -d etc] will be hardcoded, they remain the same.
What's the syntax for the last line of my macros to achieve the SaveAs?
In English, it needs to do following:
I assume I need a variable to 'capture' the current filename, and then use that? Or maybe more likely, Word already has syntax like Active.Document.Name, so I'd use
Windows 10 Pro x64 1607; Office 2016 (365 Home) x32; Win Defender, MBAM Pro
ASRock H97 Anniversary; Xeon E3-1231V3 (like i7)
Gigabyte GeForce GTX 970; 12GB Crucial DDR3 1600
Logitech MX Master mouse; Roccat Isku kb
2016-10-09, 16:33 #2
- Join Date
- Jan 2001
- Melbourne, Victoria, Australia
- Thanked 270 Times in 247 Posts
The property you want is ActiveDocument.Name but you will see that it includes the suffix. To remove that you could use
Split(ActiveDocument.Name,".")(0)Andrew Lockton, Chrysalis Design, Melbourne Australia