Existence and Name of a picture in a Range 
Author Message
 Existence and Name of a picture in a Range

Does anyone know how to determine if a picture (or shape) exists in a range
and what its name is?


Sat, 09 Nov 2002 03:00:00 GMT  
 Existence and Name of a picture in a Range
Hi Ned,

On the assumption that the Picture is in an IncludePicture field, the
following commands will get the code of the field which you can parse to get
the name of the picture:

Dim afield As Field
For Each afield In Selection.Fields
    If afield.Type = wdFieldIncludePicture Then
        MsgBox afield.Code
    End If
Next afield

Hope this helps,
Doug Robbins - Word MVP
Please post any follow-up to the Newsgroups so that others may benefit
therefrom or contribute thereto.

Quote:
> Does anyone know how to determine if a picture (or shape) exists in a
range
> and what its name is?



Sun, 10 Nov 2002 03:00:00 GMT  
 Existence and Name of a picture in a Range
Hi Ned,

Use the ShapeRange property of the range. You can .Count the number of
shapes, then use For...Next to get the names of each. Bit of sample code for
you, that I ran in the Debug window

?ActiveDocument.Range.ShapeRange.Count
 1
?ActiveDocument.Range.ShapeRange(1).Name
Rectangle 2

Quote:
> Does anyone know how to determine if a picture (or shape) exists in a range
> and what its name is?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Sun, 10 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Pasting a Picture into a Range

2. Query adds a range name to the file

3. get data from excel name range

4. Transferspreadsheet method and named ranges in Excel97

5. Query adds a range name to the file

6. using range names in excel

7. Search for References to Named Ranges

8. determining if active cell is within a named range

9. Naming file with certain range??

10. Named ranges in excel....

11. Getting a handle to Named ranges in excel

12. Naming Ranges Programmatically

 

 
Powered by phpBB® Forum Software