Solved

HowTo: replace an image by another one using VBA

Posted on 2008-06-15
2
1,271 Views
Last Modified: 2013-11-05
I have more 2000 documents were the company logo needs to be changed.
The logo is a jpg image that is located in a table. This table is a 3*3 cells were cells in column 1 were merged (the logo is here), cells in column 2 are merged.
I need to replace the logo in column 1 by another logo. The table is located at the top of every page but is not part of a page header.
Currently, picture seems to be an InlineShape object.
Stefri
0
Comment
Question by:stefri
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 21790062
This seems to work
Dim wdDoc As Word.Document

'...

    wdDoc.Tables(1).Cell(1, 1).Range.InlineShapes(1).Delete

    wdDoc.Tables(1).Cell(1, 1).Range.InlineShapes.AddPicture "C:\My Pictures\sample.jpg"

Open in new window

0
 
LVL 13

Author Closing Comment

by:stefri
ID: 31467386
Worked as a charm. I just have to automate the process.
Thanks a lot
Stefri
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now