Solved

HowTo: replace an image by another one using VBA

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

When creating Microsoft Word-based forms there may be a need to have a form field repeated throughout the whole document. For instance, with a company name, you may want this information repeated automatically throughout the document rather than man…
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 the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
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…

772 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