How to determine if cell is populated

D

Dave

I need to know how to determine if a table cell contains data.
Specifically, how can I tell if an image is present in a cell
using Visual Basic.

TIA
Dave
 
P

Perry

Here's some sample vbA code examplifying
a search in a table for inlineshapes in a table cell.

Dim c As Cell
With ActiveDocument.Tables(1)
For Each c In .Range.Cells
If c.Range.InlineShapes.Count Then
MsgBox "inlineshape in cell(" & c.RowIndex & ", " &
c.ColumnIndex & ")"
Else
MsgBox "no pics"
End If
Next
End With

Now, try to figure how to test whether the inlineshape (identified using
above code sequence)
is a picture, using below information on InlineShape types.

Straight from VBA Help:
WdInlineShapeType can be one of these WdInlineShapeType constants.
wdInlineShapeEmbeddedOLEObject
wdInlineShapeHorizontalLine
wdInlineShapeLinkedOLEObject
wdInlineShapeLinkedPicture
wdInlineShapeLinkedPictureHorizontalLine
wdInlineShapeOLEControlObject
wdInlineShapeOWSAnchor
wdInlineShapePicture
wdInlineShapePictureBullet
wdInlineShapePictureHorizontalLine
wdInlineShapeScriptAnchor

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top