G
Guest
Hi all,
I am trying to write a code that will create a list of all the
AlternativeText (HTML) names for every shape on a worksheet. The 'shapes'
are photographs and the AlternativeText names are the serial numbers required
for ordering copies of them. i want to be able to add and delete photographs
to the worksheet until I am happy with th ones I have (around 100), then list
them for convenience of ordering.
I have been able to get a msgbox to display each of the numbers in turn, but
not list them at the same time. Here's what I have so far:
Dim SHAPENo As Integer
Dim Msg, Style, Title, Response
Dim shapename As Long
Msg = "Do you want to list photos?" ' Define message.
Style = vbYesNo ' Define buttons.
Title = "List Photos?" ' Define title.
SHAPENo = 0
SHAPENo = ActiveSheet.Shapes.Count
ActiveSheet.Hyperlinks.Delete
MsgBox "Number of Photos: " & SHAPENo
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
With ActiveSheet.Shapes
For sh = 1 To SHAPENo
With .Item(sh)
shapename = .AlternativeText ' Get serial number.
MsgBox shapename
End With
Next sh
End With
Else ' User chose No.
MsgBox "no" ' Do nothing.
End If
I am trying to write a code that will create a list of all the
AlternativeText (HTML) names for every shape on a worksheet. The 'shapes'
are photographs and the AlternativeText names are the serial numbers required
for ordering copies of them. i want to be able to add and delete photographs
to the worksheet until I am happy with th ones I have (around 100), then list
them for convenience of ordering.
I have been able to get a msgbox to display each of the numbers in turn, but
not list them at the same time. Here's what I have so far:
Dim SHAPENo As Integer
Dim Msg, Style, Title, Response
Dim shapename As Long
Msg = "Do you want to list photos?" ' Define message.
Style = vbYesNo ' Define buttons.
Title = "List Photos?" ' Define title.
SHAPENo = 0
SHAPENo = ActiveSheet.Shapes.Count
ActiveSheet.Hyperlinks.Delete
MsgBox "Number of Photos: " & SHAPENo
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
With ActiveSheet.Shapes
For sh = 1 To SHAPENo
With .Item(sh)
shapename = .AlternativeText ' Get serial number.
MsgBox shapename
End With
Next sh
End With
Else ' User chose No.
MsgBox "no" ' Do nothing.
End If