Solved

HowTo: replace an image by another one using VBA

Posted on 2008-06-15
2
1,274 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft Word Pop Up Form 7 51
Need a poor man's PowerPoint 5 129
MS Word Formatting 3 63
Converting large .PDF files. 6 65
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

809 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