Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tabstops removed after assigning style

2 views
Skip to first unread message

Mamue

unread,
Feb 4, 2008, 5:01:52 AM2/4/08
to
Hi,

when i assign a special style to any text in my word document, the
tabstops are removed. i just want to change the corresponding
character style, not my tabstops.

thanks, matthias

reita...@yahoo.com

unread,
Feb 4, 2008, 11:02:29 AM2/4/08
to
Styles contain both character and paragraph formats, so your tabs will
be replaced whenever you apply a style. You can add the tabs to the
style or create a new style that contains the same formatting plus the
tabs.

Sorry.

klaus...@gmail.com

unread,
Feb 5, 2008, 12:34:04 PM2/5/08
to
On 4 Feb., 11:01, Mamue <mamuesmail...@googlemail.com> wrote:
> Hi,
>
> when i assign a specialstyleto any text in my word document, the

> tabstops are removed. i just want to change the corresponding
> characterstyle, not my tabstops.
>
> thanks, matthias

Hi Matthias,

With a little VBA, you can write a macro that applies some style to a
paragraph without changing the tab stops:


Call ApplyStyleOldTabs("Heading 1")


Sub ApplyStyleOldTabs(StyleName As String)
Dim myPF As ParagraphFormat
Dim myTab As TabStop
Set myPF = Selection.ParagraphFormat.Duplicate
' Apply style
Selection.Style = ActiveDocument.Styles(StyleName)
' Re-set TabStops
Selection.ParagraphFormat.TabStops.ClearAll
For Each myTab In myPF.TabStops
Selection.ParagraphFormat.TabStops.Add _
myTab.Position, _
myTab.Alignment, _
myTab.Leader
Next myTab
End Sub

0 new messages