V
vbasteve
I understand that the "TabStops collection represents all the custom and
default tab stops in a paragraph or group of paragraphs."
I'm creating tabstops via code such like this:
Dim HPosRel2Page As Integer
Application.Selection.Collapse direction:=wdCollapseEnd
HPosRel2Page =
Application.Selection.Information(wdHorizontalPositionRelativeToPage)
'Creates a tab stop at current IP location...
Application.ActiveDocument.Paragraphs.TabStops.Add HPosRel2Page
I have also set the default tab stop for the activeDoc to 500pt.
(essentially removing all default tab stops)
Application.ActiveDocument.DefaultTabStop = 500
If I run the following code snippit all is good,
iNumTabs = Application.ActiveDocument.Paragraphs.tabStops.Count
However, if I try to manually adjust a tabstop that was added via code by
using the ruler (Left click and drag) and then run
iNumTabs = .Paragraphs.tabStops.Count
I am getting the following error message:
Runtime Error 5920
This TabStops Collection Has Mixed Tab Settings
I can supress the error message with a simple function call, but I loose the
ability to manually adjust a tabstop.
Public Function IsCustomTabStop(iTabNum As Integer) As Boolean
'Check to see if this tab is a custom tab stop....
'Comment out On Error to display error message...
On Error Resume Next
If Application.ActiveDocument.Paragraphs.tabStops(iTabNum).CustomTab
Then
IsCustomTabStop = True
Else
IsCustomTabStop = False
End If
End Function
So my question is: What are Mixed Tab Settings?
default tab stops in a paragraph or group of paragraphs."
I'm creating tabstops via code such like this:
Dim HPosRel2Page As Integer
Application.Selection.Collapse direction:=wdCollapseEnd
HPosRel2Page =
Application.Selection.Information(wdHorizontalPositionRelativeToPage)
'Creates a tab stop at current IP location...
Application.ActiveDocument.Paragraphs.TabStops.Add HPosRel2Page
I have also set the default tab stop for the activeDoc to 500pt.
(essentially removing all default tab stops)
Application.ActiveDocument.DefaultTabStop = 500
If I run the following code snippit all is good,
iNumTabs = Application.ActiveDocument.Paragraphs.tabStops.Count
However, if I try to manually adjust a tabstop that was added via code by
using the ruler (Left click and drag) and then run
iNumTabs = .Paragraphs.tabStops.Count
I am getting the following error message:
Runtime Error 5920
This TabStops Collection Has Mixed Tab Settings
I can supress the error message with a simple function call, but I loose the
ability to manually adjust a tabstop.
Public Function IsCustomTabStop(iTabNum As Integer) As Boolean
'Check to see if this tab is a custom tab stop....
'Comment out On Error to display error message...
On Error Resume Next
If Application.ActiveDocument.Paragraphs.tabStops(iTabNum).CustomTab
Then
IsCustomTabStop = True
Else
IsCustomTabStop = False
End If
End Function
So my question is: What are Mixed Tab Settings?