B
Barbara
I am working on a macro to format graphics. (I owe it mainly to one of the
Word MVPs, but I have forgotten exactly where I found it. I am grateful to
the author, whoever it was.)
The macro starts by checking whether a floating shape, in-line shape, or
neither is selected. The in-line case is the one where I need some help. I
want to convert it to a floating shape and specify some layout settings. That
part is working fine. I also want to check whether the shape is in an
otherwise empty paragraph and, if so, delete the paragraph, leaving the shape
anchored to the preceding paragraph.
My current strategy is:
If an in-line shape is selected, then,
If the paragraph where the selection starts contains two characters
(namely, the shape and the paragraph break),
move the shape up one paragraph,
delete the now-empty paragraph
end if
convert to a floating shape
end if
etc.
After looking around on this site and the Word MVP site, I have constructed
an expression that works (I think) for "the paragraph where the selection
starts." But it is astonishingly long and obscure.
What is the simplest way of writing this expression? It seems like this is a
rather basic concept (also applicable to "the paragraph that holds this
sentence," "the table that holds this cell," "the section that holds this
character,"...) But I'm not finding any info about how to refer to it.
Thanks for all your help!
Word MVPs, but I have forgotten exactly where I found it. I am grateful to
the author, whoever it was.)
The macro starts by checking whether a floating shape, in-line shape, or
neither is selected. The in-line case is the one where I need some help. I
want to convert it to a floating shape and specify some layout settings. That
part is working fine. I also want to check whether the shape is in an
otherwise empty paragraph and, if so, delete the paragraph, leaving the shape
anchored to the preceding paragraph.
My current strategy is:
If an in-line shape is selected, then,
If the paragraph where the selection starts contains two characters
(namely, the shape and the paragraph break),
move the shape up one paragraph,
delete the now-empty paragraph
end if
convert to a floating shape
end if
etc.
After looking around on this site and the Word MVP site, I have constructed
an expression that works (I think) for "the paragraph where the selection
starts." But it is astonishingly long and obscure.
What is the simplest way of writing this expression? It seems like this is a
rather basic concept (also applicable to "the paragraph that holds this
sentence," "the table that holds this cell," "the section that holds this
character,"...) But I'm not finding any info about how to refer to it.
Thanks for all your help!