A
andreas
Dear Experts:
I wrote two macros that insert figure caption numbering automatically
by using AutoText entries:
The macros go as follows:
1. Automatic Caption numbering for figures directly following heading
level 1:
Application.DisplayAutoCompleteTips = True
ActiveDocument.AttachedTemplate.AutoTextEntries("Caption_Numbering_1").Insert
_
Where:=Selection.Range, RichText:=True
Result: e.g.,
"Figure" 2-1: .......
The field code behind the autotext entry:
"Figure" {STYLEREF Custom_Heading_Style_Level_1 \s}-{SEQ Figure \*
ARABIC \r 1}: .......
2. Automatic Caption numbering for figures that are counted
sequentially after the first one within a chapter
Application.DisplayAutoCompleteTips = True
ActiveDocument.AttachedTemplate.AutoTextEntries("Caption_Numbering_2").Insert
_
Where:=Selection.Range, RichText:=True
Example:
"Figure" 2-2: ........
The field codes behind the AutoTextEntries are as follows:
"Figure" {STYLEREF Custom_Heading_Style_Level_1 \s}-{SEQ Figure \*
ARABIC}: .......
Now here comes my question:
Is it possible to merge these two macros into just one, i.e. whenever a
caption numbering is inserted the macro should check within a given
chapter (1,2,3 etc.) whether the inserted figure or table is the first
one in this chapter, i.e. {STYLEREF Custom_Heading_Style_Level_1}-{SEQ
Bild \* ARABIC \r 1} or not ({STYLEREF
Custom_Heading_Style_Level_1}-{SEQ Bild \* ARABIC}).
I hope I did make myself clear. Help is appreciated.
Thanks in advance.
Regards,
Andreas
I wrote two macros that insert figure caption numbering automatically
by using AutoText entries:
The macros go as follows:
1. Automatic Caption numbering for figures directly following heading
level 1:
Application.DisplayAutoCompleteTips = True
ActiveDocument.AttachedTemplate.AutoTextEntries("Caption_Numbering_1").Insert
_
Where:=Selection.Range, RichText:=True
Result: e.g.,
"Figure" 2-1: .......
The field code behind the autotext entry:
"Figure" {STYLEREF Custom_Heading_Style_Level_1 \s}-{SEQ Figure \*
ARABIC \r 1}: .......
2. Automatic Caption numbering for figures that are counted
sequentially after the first one within a chapter
Application.DisplayAutoCompleteTips = True
ActiveDocument.AttachedTemplate.AutoTextEntries("Caption_Numbering_2").Insert
_
Where:=Selection.Range, RichText:=True
Example:
"Figure" 2-2: ........
The field codes behind the AutoTextEntries are as follows:
"Figure" {STYLEREF Custom_Heading_Style_Level_1 \s}-{SEQ Figure \*
ARABIC}: .......
Now here comes my question:
Is it possible to merge these two macros into just one, i.e. whenever a
caption numbering is inserted the macro should check within a given
chapter (1,2,3 etc.) whether the inserted figure or table is the first
one in this chapter, i.e. {STYLEREF Custom_Heading_Style_Level_1}-{SEQ
Bild \* ARABIC \r 1} or not ({STYLEREF
Custom_Heading_Style_Level_1}-{SEQ Bild \* ARABIC}).
I hope I did make myself clear. Help is appreciated.
Thanks in advance.
Regards,
Andreas