I create a bookmark call Logo at my Word Template. The logo will call out
base on selection. Found that if i change my option, the new option logo will
overlapping the old logo. I hope can clear the old logo and new logo replace
base on new option.
Below is my code:
With wb.Sheets(2)
LastRow = .Range("A65536").End(xlUp).Row
For z = 2 To LastRow
If (.Range("A" & z).Text) = cboBusiness.Value Then
'Check Image
If Len(Dir("C:\Program Files\Microsoft Office\Templates\"
& (.Range("D" & z).Text))) > 0 Then
ActiveDocument.Bookmarks("Logo").Range.InlineShapes.
AddPicture FileName:="C:\Program Files\Microsoft Office\Templates\" & (.Range
("D" & z).Text), LinkToFile:=False
End If
End If
Next z
End With
Thanks.
Due to the difficulty of working with bookmarks, can you have a table into
which you insert the logo.
Assuming that it's the first table in the document and that it only contains
one cell, then you can use
With ActiveDocument.Tables(1).Cell(1,1).Range
.Delete
.InlineShapes.AddPicture FileName:="C:\Program Files\Microsoft
Office\Templates\" & _
(.Range("D" & z).Text), LinkToFile:=False
End With
Which will clear anything from the cell and insert the logo into it.
Using a bookmark, it is very hard to avoid deleting the bookmark when trying
to do something like this.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I create a bookmark call Logo at my Word Template. The logo will call out
> base on selection. Found that if i change my option, the new option logo
[quoted text clipped - 34 lines]
>>>
>>> Thanks.
teddy b - 28 Aug 2005 03:27 GMT
Thanks Doug. It's work. Now i got other problem.
My table is in header. How to place my logo there and how to wrap my logo
(set to Through in my code?) so that i want it to show in my document but not
to printed out.
Thanks a lot.
>Due to the difficulty of working with bookmarks, can you have a table into
>which you insert the logo.
[quoted text clipped - 19 lines]
>>>>
>>>> Thanks.
Doug Robbins - 28 Aug 2005 07:15 GMT
With
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
1).Range
.Delete
.InlineShapes.AddPicture FileName:="C:\Program Files\Microsoft
Office\Templates\" & _
(.Range("D" & z).Text), LinkToFile:=False
End With
Will deal with a table in the primary header of the document.
If you don't want the logo to print, uncheck the "Drawing objects" box under
Tools>Options>Print

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Thanks Doug. It's work. Now i got other problem.
>
[quoted text clipped - 30 lines]
>>>>>
>>>>> Thanks.
teddy b - 31 Aug 2005 08:36 GMT
I had reply to this msg but it look like not stored?
>With
>ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
[quoted text clipped - 14 lines]
>>>>>>
>>>>>> Thanks.
teddy b - 31 Aug 2005 08:40 GMT
I try that b4 but it not working. I'm include this to my script Application.
Options.PrintDrawingObjects = False and the Tools ->Obtions ->Print ->
Drawing Objects is uncheck. Mission Failed.
It only work after i wrap it manually. How to wrap the image within a FRAME
and TABLE in header?
Thanks.
cheer,
teddy
>I had reply to this msg but it look like not stored?
>
[quoted text clipped - 3 lines]
>>>>>>>
>>>>>>> Thanks.