E
Ed
I am creating a macro to insert captions on tables in my reports.
Obviously, any time I run this on a report more than once, I don't need to
insert a new caption over the top of a previous one. The macro finds the
text string I am using for the caption, which is the same text for both
inserted captions and newly-inserted tables with a generic place-holder.
Can I check the selected text for: is this a caption? or: does it contain a
number field? or; is this Caption style? My idea is to have the macro find
the caption text, then place all my code in an IF statement based on one of
the above conditions (or another one that will work, if you have any other
ideas) = FALSE. So it would be something like:
If Selection.Find.Found = True
If Selection [is caption] [contains field] [Caption style] = False
' run code
Else 'find next
End If
Else ' end game
End If
Ed
Obviously, any time I run this on a report more than once, I don't need to
insert a new caption over the top of a previous one. The macro finds the
text string I am using for the caption, which is the same text for both
inserted captions and newly-inserted tables with a generic place-holder.
Can I check the selected text for: is this a caption? or: does it contain a
number field? or; is this Caption style? My idea is to have the macro find
the caption text, then place all my code in an IF statement based on one of
the above conditions (or another one that will work, if you have any other
ideas) = FALSE. So it would be something like:
If Selection.Find.Found = True
If Selection [is caption] [contains field] [Caption style] = False
' run code
Else 'find next
End If
Else ' end game
End If
Ed