Hi,
I have been using the following Excel Macro which erases all the properties (Custom and embedded) from all MS Excel files placed in the folder c:\folder1\.
VB Code:
'--------Code Start-------------- Sub Properties() MyPath = "C:\folder1" MyFile = Dir(MyPath & Application.PathSeparator & _ "*.xls", vbDirectory) Application.ScreenUpdating = False Do While MyFile <> "" If MyFile = ThisWorkbook.Name Then GoTo ResumeSub: Workbooks.Open (MyPath & "\" & MyFile) For I = ActiveWorkbook.CustomDocumentProperties.Count To 1 Step -1 ActiveWorkbook.CustomDocumentProperties.Item(I).Delete Next On Error Resume Next For I = ActiveWorkbook.BuiltinDocumentProperties.Count To 1 Step -1 ActiveWorkbook.BuiltinDocumentProperties.Item(I) = "" Next Workbooks(MyFile).Close True ResumeSub: MyFile = Dir Loop Application.ScreenUpdating = True End Sub '--------Code End--------------
Similarly, I have been using the following VBA code for MS Word files as an embedded macro.
VB Code:
'---------Code Start---------- Sub Properties() MyPath = "C:\folder1" MyFile = Dir(MyPath & Application.PathSeparator & _ "*.doc", vbDirectory) Application.ScreenUpdating = False Do While MyFile <> "" If MyFile = ThisDocument.Name Then GoTo ResumeSub: Documents.Open (MyPath & "\" & MyFile) For I = ActiveDocument.CustomDocumentProperties.Count To 1 Step -1 ActiveDocument.CustomDocumentProperties.Item(I).Delete Next On Error Resume Next For I = ActiveDocument.BuiltInDocumentProperties.Count To 1 Step -1 ActiveDocument.BuiltInDocumentProperties.Item(I) = "" Next Documents(MyFile).Close True ResumeSub: MyFile = Dir Loop Application.ScreenUpdating = True End Sub '--------Code End--------------
Now I want to convert these 2 macros to a standalone single VB application which will erase all the file properties from all the Excel and Word files kept in c:\folder1\.
Going further, can somebody help me design a code which can do the same for MS PowerPoint files?
Please can someone help me in this.
Thanks in Advance,
Lonely




Reply With Quote