Goto Shape - on screen

A

androo...

I have the following macro to convert shapes to InLine shapes but I can't
see which shape is selected. How can I scroll to the selected shape on
screen?


Sub Obj_floating_to_inline()
On Error Resume Next
Dim myShape As Variant
Dim convertMsg As Variant
For Each myShape In ActiveDocument.Shapes
myShape.Select
convertMsg = MsgBox("Do you want to convert this to an InLine
shape?", vbQuestion + vbYesNo, "Convert?")
If convertMsg = vbYes Then
myShape.ConvertToInlineShape
End If
Next
End Sub


Thanks,
androoooooooo...............
 
S

Shauna Kelly

Hi Androoooooo

You need the ScrollIntoView method:

Dim oILS as Word.InlineShape

' stuff here

set oILS = myShape.ConvertToInlineShape
ActiveDocument.Windows(1).ScrollIntoView oILS.Range, True

There's more information in VBA help on ScrollIntoView.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
A

androo...

Thanks Shauna. I hadn't come across that method before.

regards,
androoooooooooooo......................
 

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