Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

remove picture in word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen - 01 Jul 2007 17:48 GMT
How could I remove a picture in word doc without opening it.
Tks,
Stephen
old man - 02 Jul 2007 04:08 GMT
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
Graham Mayor - 02 Jul 2007 07:30 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.