R
RosH
Hi Everyone,
I have posted this question already in the group with no results.
Now, I have done some of the macro but please help me on what is
missing. Thank you in advance.
I have an excel sheet in which it has a column full of paths of Word
files of which some are big in size due to the embeded images it
contains (mostly done through insert>Picture>from file). Can someone
please help me make a macro which would go through all the files one by
one, check for photos, if found delete them or unembed them and then
save changes.
CELL B1 CONTAINS THE DIRECTORY PATH AND COLUMN B (FROM ROW 4) CONTAINS
FILE NAMES
----------------Code Start------------------------------------
Dim WordApp As Word.Application
Set WordApp = New Word.Application
WordApp.Visible = False
For Each nDocFile In Range("B4:B" & FindLastRow("B4")).Cells
sDoc = Range("B1").Value & Application.PathSeperator &
nDocFile.Value
nDocFile.Select
WordApp.Documents.Open (sDoc)
'WHAT SHOULD I CODE HERE???
WordApp.Documents.Close savechanges:=True
Next
WordApp.Quit
Set WordApp = Nothing
------------------------CODE
ENDS------------------------------------------
I have posted this question already in the group with no results.
Now, I have done some of the macro but please help me on what is
missing. Thank you in advance.
I have an excel sheet in which it has a column full of paths of Word
files of which some are big in size due to the embeded images it
contains (mostly done through insert>Picture>from file). Can someone
please help me make a macro which would go through all the files one by
one, check for photos, if found delete them or unembed them and then
save changes.
CELL B1 CONTAINS THE DIRECTORY PATH AND COLUMN B (FROM ROW 4) CONTAINS
FILE NAMES
----------------Code Start------------------------------------
Dim WordApp As Word.Application
Set WordApp = New Word.Application
WordApp.Visible = False
For Each nDocFile In Range("B4:B" & FindLastRow("B4")).Cells
sDoc = Range("B1").Value & Application.PathSeperator &
nDocFile.Value
nDocFile.Select
WordApp.Documents.Open (sDoc)
'WHAT SHOULD I CODE HERE???
WordApp.Documents.Close savechanges:=True
Next
WordApp.Quit
Set WordApp = Nothing
------------------------CODE
ENDS------------------------------------------