P
Phil Crosby
I'm working with many InlineShapes and need to move them around the document.
Getting the Range they're anchored to and changing it (e.g. modifying "Start"
and "End" properties) doesn't seem to have any effect.
I can, in the Word document, cut and paste an InlineShape (thus moving it).
However, you have to select, in addition to the InlineShape, a character
before it or after it for the selection to "appear" and for you to be able to
cut it.
If I access the Range of the InlineShape programmatically and try and select
it or cut it, nothing happens. If I grow the range by a character, I _can_
select that, and then cut it. A hack way of moving the InlineShape is to
insert some whitespace before or after the InlineShape, select it, cut it,
and delete the whitespace on pasting.
Is there a less circuitous way of moving the InlineShape around in the
document?
(I realize, besides cutting and pasting, I can also use Range.Move() to move
it)
Someone in this thread mentioned the Shape.Range.Position property, which
VSTO doesn't expose apparently.
http://msdn.microsoft.com/newsgroup...ficedev-word&lang=en&cr=US&sloc=en-us&m=1&p=1
I posted this question previously in the VSTO forum, but they suggested I
come here.
Thanks
Getting the Range they're anchored to and changing it (e.g. modifying "Start"
and "End" properties) doesn't seem to have any effect.
I can, in the Word document, cut and paste an InlineShape (thus moving it).
However, you have to select, in addition to the InlineShape, a character
before it or after it for the selection to "appear" and for you to be able to
cut it.
If I access the Range of the InlineShape programmatically and try and select
it or cut it, nothing happens. If I grow the range by a character, I _can_
select that, and then cut it. A hack way of moving the InlineShape is to
insert some whitespace before or after the InlineShape, select it, cut it,
and delete the whitespace on pasting.
Is there a less circuitous way of moving the InlineShape around in the
document?
(I realize, besides cutting and pasting, I can also use Range.Move() to move
it)
Someone in this thread mentioned the Shape.Range.Position property, which
VSTO doesn't expose apparently.
http://msdn.microsoft.com/newsgroup...ficedev-word&lang=en&cr=US&sloc=en-us&m=1&p=1
I posted this question previously in the VSTO forum, but they suggested I
come here.
Thanks