![]() |
#1
|
|||
|
|||
![]()
I currently use the following macro to scrub, password protect, and save Word files. Each filename contains the text "(IU)". I would like to amend the macro so that it will also replace "(IU)" with "(CR)" in the filename, before saving it.
Sub ThirdPartyDocsScrubLockSaveClose() ' ' ThirdPartyDocsScrubLockSaveClose Macro ' ' ActiveDocument.RemoveDocumentInformation (wdRDIDocumentProperties) ActiveDocument.RemoveDocumentInformation (wdRDIDocumentServerProperties) ActiveDocument.RemoveDocumentInformation (wdRDIContentType) ActiveDocument.Protect Password:="12345", NoReset:=False, Type:= _ wdAllowOnlyReading, UseIRM:=False, EnforceStyleLock:=True CommandBars("Restrict Editing").Visible = False ActiveDocument.Save ActiveDocument.Close End Sub |
#2
|
||||
|
||||
![]()
Try:
Code:
Sub ThirdPartyDocsScrubLockSaveClose() With ActiveDocument .RemoveDocumentInformation (wdRDIDocumentProperties) .RemoveDocumentInformation (wdRDIDocumentServerProperties) .RemoveDocumentInformation (wdRDIContentType) .Protect Password:="12345", NoReset:=False, Type:=wdAllowOnlyReading, UseIRM:=False, EnforceStyleLock:=True .SaveAs2 FileName:=Replace(.FullName, "(IU)", "(CR)"), AddToRecentFiles:=False .Close False End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
That worked. Thank you very much.
|
![]() |
Tags |
modify filename |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ClaireLivings | Word | 1 | 04-14-2016 08:08 AM |
![]() |
Deniz | Word | 1 | 02-28-2016 09:01 AM |
Change color of existing borders for an existing table | JayUSA | PowerPoint | 1 | 01-21-2016 04:21 PM |
Change one page number in existing TOC Word 2013 | MK-NY | Word | 2 | 04-03-2014 03:59 AM |
hey guys, need to edit a certain part of a word file but its greyed out | winter83 | Word | 0 | 08-17-2010 07:04 PM |