Inlineshapes

P

paradigm

I am using an inlineshape as a signature on letters. The user can
automatically insert a scanned signature. (controlled by Access 2003)
The problem I have is removing the signature if someone else want to sign
the document. I have a routine which removes all inlineshapes from a
document but there is a danger that a user may insert their own inlineshapes
and these would also be deleted.
How can I identify a particular shape and then delete it?
Alex
 
J

Jonathan West

paradigm said:
I am using an inlineshape as a signature on letters. The user can
automatically insert a scanned signature. (controlled by Access 2003)
The problem I have is removing the signature if someone else want to sign
the document. I have a routine which removes all inlineshapes from a
document but there is a danger that a user may insert their own
inlineshapes and these would also be deleted.
How can I identify a particular shape and then delete it?
Alex

If you use VBA to insert an inline shape, you can set the Name of the shape
to something distinctive. Or you can set the AlternativeText property to
"Signature" or something similar. Then when you are deleting inline shapes,
you can delete only those which you have tagged in this way.
 
P

paradigm

Have you any smaple code that shows how I could assign a name to it and
then select it again for deletion. Thanks.
Alex
 
H

Helmut Weber

Hi Alec,

like this:

Sub Macro7a()
Dim oInl As InlineShape

Set oInl = Selection.InlineShapes.AddPicture _
("C:\test\bild\smallfail.gif")
oInl.AlternativeText = "Failure"
Set oInl = Selection.InlineShapes.AddPicture _
("C:\test\bild\smallsuccess.gif")
oInl.AlternativeText = "Success"
Set oInl = Selection.InlineShapes.AddPicture _
("C:\test\bild\exclam.gif")
oInl.AlternativeText = "Exclamation"
For Each oInl In ActiveDocument.InlineShapes
If oInl.AlternativeText = "Failure" Then
oInl.Delete
End If
Next
End Sub

Astonishingly enough, not all objects
have a name property. Shapes have,
inlineshapes don't.

I'm still learning.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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