For instance, the sentences like, "By planting more trees, we can save the earth." and "After drinking wine, he danced."
In the first example ("By planting more trees"), the verbal noun planting takes a direct object in the accusative, for which A&G notes we should rather use the gerundive:
The gerund with a direct object is practically limited to the genitive and the ablative (without a preposition); even in these cases the gerundive is commoner.
As noted in the same source, when choosing the gerundive, the direct object should take the same case; which in our case is the ablative case ("By planting trees..."), thus:
"serendis arboribus pluribus, possumus orbem terrarum servare"
[If we want to stick to the less-common gerund (which is only possible since we are in the ablative case): serendo arbores plures (here the direct object has its usual form in the accusative)]
It seems we can apply the same method for the second example; but if we are not confined to the gerundive, we might use a simple verb (in that case we have specific subject) ["postquam vinum bibit ...], or a participle construction (noun + participle) like "post natos homines" (after the creation of man) or "ab urbe condita", in our case "post vinum bibitum, saltavit"