I used to have some very useful WordBasic macros that I am
now in the process of converting to VBA. Most of the code
converts to VBA well but I am stumped with how to get the
setting for including the number of the previous heading
level for a nominated built-in heading style.
For example, if the Heading1 style uses Arabic numbering
(e.g. 1, 2, 3), I want to be able to determine whether the
Heading2 style is set include the number of the Heading1
style in its numbering (e.g. 1.1, 1.2, 1.3, 2.1, 2.2, 2.3).
This was done with the Include parameter in Wordbasic. The
converted (to VBA) code looks like thisL
'Get include value from H2
Dim FHN As Object: Set FHN =
WordBasic.DialogRecord.FormatHeadingNumber(False)
FHN.Level = 2
WordBasic.CurValues.FormatHeadingNumber FHN
H2IncludePreviousNumber = FHN.include
'Set include value for H2
WordBasic.FormatHeadingNumber
include:=H2IncludePreviousNumber
Interestingly, while I cannot retrieve the include value
I can set it using the above method.
I am quite happy to relinquish the old Wordbasic code but
I cannot for the life of me find out how to do what I want
with VBA.
All suggestions gratefully accepted.
now in the process of converting to VBA. Most of the code
converts to VBA well but I am stumped with how to get the
setting for including the number of the previous heading
level for a nominated built-in heading style.
For example, if the Heading1 style uses Arabic numbering
(e.g. 1, 2, 3), I want to be able to determine whether the
Heading2 style is set include the number of the Heading1
style in its numbering (e.g. 1.1, 1.2, 1.3, 2.1, 2.2, 2.3).
This was done with the Include parameter in Wordbasic. The
converted (to VBA) code looks like thisL
'Get include value from H2
Dim FHN As Object: Set FHN =
WordBasic.DialogRecord.FormatHeadingNumber(False)
FHN.Level = 2
WordBasic.CurValues.FormatHeadingNumber FHN
H2IncludePreviousNumber = FHN.include
'Set include value for H2
WordBasic.FormatHeadingNumber
include:=H2IncludePreviousNumber
Interestingly, while I cannot retrieve the include value
I can set it using the above method.
I am quite happy to relinquish the old Wordbasic code but
I cannot for the life of me find out how to do what I want
with VBA.
All suggestions gratefully accepted.