views:

88

answers:

1

We're currently doing some Word automation, and want to be able to insert a Style Separator into a Range object. We've found how to do it with the Selection object (InsertStyleSeparator) but can't seem to figure out how to do that with Range objects. Does anyone know how to make that work?

Relevant links I've found so far:

+1  A: 

VBA documentation says that InsertStyleSeparator is a member of the Selection object.

That means you need a Selection object. Luckily you can do:

SomeRangeObject.Select
Selection.InsertStyleSeparator
Tomalak
Thanks. Selection still won't work for us, because if the user happens to click or edit the doc during that brief moment wonky things happen (which is why we're using range). But I'm marking your answer as accepted since that's likely the only way. ;)
Cory Foy
You could try to prevent user interaction during your update period. Maybe displaying a modal "splash/please wait" dialog? Excel has "Application.Interactive", unfortunately Word does not. :-\
Tomalak