[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1288
  • Last Modified:

HowTo: replace an image by another one using VBA

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
stefri
Asked:
stefri
1 Solution
 
GrahamSkanCommented:
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
 
stefriAuthor Commented:
Worked as a charm. I just have to automate the process.
Thanks a lot
Stefri
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now