Thứ Ba, 7 tháng 8, 2018

Xóa tất cả ảnh trong file Word

Remove all pictures from document by using VBA code

Using VBA code is another easier way to remove all pictures from document. You can use a VBA code as follows to remove all pictures from document.
Step 1: Press the Alt + F11 keys to open the Microsoft Visual Basic for Application window;
Step 2: Click Insert > Module, copy and paste the following VBA code into the Module window;
Step 3: Click the Run button to apply the VBA.
VBA code: Remove all pictures from document:

Sub DitchPictures()
Dim objPic As InlineShape
For Each objPic In ActiveDocument.InlineShapes
objPic.Delete
Next objPic
End Sub