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

Re: Inlineshapes by Jonathan

Jonathan
Thu Aug 02 04:31:45 CDT 2007


"paradigm" <alecjames1.nospam@hotmail.com> wrote in message
news:eej6VeO1HHA.4712@TK2MSFTNGP04.phx.gbl...
>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.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup



Re: Inlineshapes by paradigm

paradigm
Thu Aug 02 04:58:50 CDT 2007

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

"Jonathan West" <jwest@mvps.org> wrote in message
news:e7ZgRrO1HHA.6072@TK2MSFTNGP03.phx.gbl...
>
> "paradigm" <alecjames1.nospam@hotmail.com> wrote in message
> news:eej6VeO1HHA.4712@TK2MSFTNGP04.phx.gbl...
>>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.
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>


Re: Inlineshapes by Helmut

Helmut
Thu Aug 02 06:46:54 CDT 2007

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"

Re: Inlineshapes by paradigm

paradigm
Thu Aug 02 09:28:38 CDT 2007

Many thanks.
Alex

"Helmut Weber" <nbhymsjxdgcn@mailinator.com> wrote in message
news:tpg3b3lg8rlnkpvv2emq12sooang4bevi7@4ax.com...
> 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"