In English the grammatical term gerund is used only for an -ING form which is employed as a noun. When an -ING form is used as an adjective or as a component of progressive verb construction it is called a participle.
Consequently, the way to tell what you should call a specific instance of an -ING form is to determine what role it plays in the sentence.
In the case at hand, slamming ... is a clause which describes what the subject she did. It is not the subject or object of another verb, it is not marked with a determiner or any other adjective. It has to be a participle.
In the same context you might use slamming as a gerund this way:
She stormed out; slamming the door so hard that the mirror fell off the wall was her final comment on the discussion.
In this case, *slamming ... * is the subject of the verb was; slamming is a gerund.
It is usually pretty easy to figure out whether an -ING form is a participle or a gerund; but there is one tricky sort of construction. These require a subtler analysis.
In both of these, running is used to modify the following noun; but in the first, running is a participle, while in the second it is a gerund.
This may be easier to understand if I introduce a new technical term. The -ING form is traditionally called the present participle, to distinguish it from the past participle, the -ED form; but it is just as proper, and sometimes more useful to call it an active participle: a form which designates what the noun it modifies does, as opposed to the passive participle, which designates what is done to the noun it modifies.
So to discern whether an -ING form is a participle or a gerund you must ask yourself whether the action the form names is performed by the noun which it modifies.
- In running water it is in fact the water which runs, so running is a participle
- in running shoes, however, the shoes do not run; rather, they are used for running, just as tennis shoes are used for playing tennis or football shoes are used for playing soccer. In this case, running is a verb used as a noun—a gerund—which in turn is used attributively, as an adjective.
Isn’t English fun?!