How could I remove a picture in word doc without opening it.
Tks,
Stephen
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
> How could I remove a picture in word doc without opening it.
> Tks,
> Stephen
Stephen - 02 Jul 2007 13:56 GMT
Sorry, where should I put this coding. In VB macro or else ??
Tks
> Hi,
>
[quoted text clipped - 21 lines]
> > Tks,
> > Stephen
old man - 04 Jul 2007 01:00 GMT
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
> Sorry, where should I put this coding. In VB macro or else ??
> Tks
[quoted text clipped - 24 lines]
> > > Tks,
> > > Stephen
You can't edit a Word document without opening it.
With it open, select the picture and delete it.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> How could I remove a picture in word doc without opening it.
> Tks,
> Stephen