Solved

HowTo: replace an image by another one using VBA

Posted on 2008-06-15
2
1,270 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
Comment Utility
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
Comment Utility
Worked as a charm. I just have to automate the process.
Thanks a lot
Stefri
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
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…

771 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

10 Experts available now in Live!

Get 1:1 Help Now