Inserting style separators through ranges?

J

jj

Is there a way to insert a style separator character in a range. I
have found the Selection.InsertStyleSeparator() method, but I would
like to avoid the selection object if at all possible as this has
caused us trouble when working with hidden documents in the past, not
to mention the performance benefits from utilizing ranges instead of
the Selection object.

Thanks,
jj
 
H

Helmut Weber

Hi Joshua,

InsertStyleSeparator applies to the selection.object.
As you have found out.

However, once you have a styleseparator in the clipboard,
it seems, you can paste it programmatically, not manually (!),
wherever you want without using selection.

So I'd use a temporary doc,
which is the activedocument then,
plus activedocument.range(0,0).select
insert a styleseparator,
search for chr(13) and copy it.

From the on it's plain sailing, well, almost.
 
J

jj

Hi Joshua,

InsertStyleSeparator applies to the selection.object.
As you have found out.

However, once you have a styleseparator in the clipboard,
it seems, you can paste it programmatically, not manually (!),
wherever you want without using selection.

So I'd use a temporary doc,
which is the activedocument then,
plus activedocument.range(0,0).select
insert a styleseparator,
search for chr(13) and copy it.

From the on it's plain sailing, well, almost.

Thanks for the response, but for now I am just going to stick with
using the selection. We just got away from the clipboard because of
some issues we had with the clipboard sometimes being "empty or not
valid" when we tried to paste as well as user's complaints about
resetting the clipboard. And I don't think it will ever be "plain
sailing" while I am working with the Word object model :)

jj
 

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