remove picture in word

O

old man

Hi,

You can use MS Scripting to open a Word Document, set visible to false(which
I believe is the default) and delete the picture (which you would have to
figure out if its a shape or inline shape and are part of different
collections) and then save the word document after deleting the picture.

Here is a script I used to delete the second shape in the document t2.doc:

Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("c:\t2.doc")

objWord.Visible = false

Set objRange = objDoc.Range()

objRange.inlineshapes(2).delete
objdoc.Save
objWord.Quit

old man
 
G

Graham Mayor

You can't edit a Word document without opening it.
With it open, select the picture and delete it.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
O

old man

Hi Stephen,

What I suggested is to use Windows Scripting. To research how to use
scripting view this site:

http://msdn2.microsoft.com/en-us/library/ms950396.aspx

There are excellent tutorials and examples on scripting at this site.

If you know how to program you can write a VB6 program that can do what you
want (remove a picture from a Word document without opening the file.) Of
course using scripting or VB6 you are opening the file but it is being opened
'invisisbly' and without the 'normal' invocation of Word.

old man
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top