WORD of GOD
Like "spirit" πνεῦμα can have a general meaning of the essence of God (to the result that Father is πνεῦμα /cf. John 4:22/, Son is πνεῦμα /cf.1 Cor. 15:45/ and H. Ghost is πνεῦμα), and also πνεῦμα has a specific, personal-hypostatic significance as being one of the Hypostases of the Trinity /cf. John 15:26/ (to the result that Father and the Son are not πνεῦμα, but only the H.Ghost is πνεῦμα in this sense), similarly with the term "word".
On the one hand this term can mean the Hypostasis of the Son, and on the other hand it can mean the energy of action of divine will and wisdom on human heart, which energy of action is also God, albeit not with reference to the Hypostasis of Logos, but with reference of the energy and activity of God, for God's activity is also inseparable from the reality of God and thus is also God. This presence of divine energy in our hearts can even transform and embolden our hearts, helping us to find our hidden roar and turning us from cowards to heroes, from feeble men, to the titans, the titans of Spirit; like in Psalms 104:19, which says that Joseph's heart was made fiery by the presence of the word of God (τὸ λόγιον τοῦ Κυρίου ἐπύρωσεν αὐτόν), and weren't hearts of Luke and Kleopas burning (καρδία καιομένη) when hearing the inspiring words of the resurrected Lord (Luke 24:32)?
Here in Ephesians the "word" means not the Hypostasis of Logos, but the Activity, the Operation or Grace of the Hypostasis of Logos, that of the Hypostasis of Father and that of the Hypostasis of H.Ghost, that is to say, the working of the divine truth and wisdom, that belong likely to all Three of Them, in our hearts, and this Activity is the Activity that must govern and conquer any other activity in us.
For instance, if I have in my heart an activity of an infatuating romantic eros towards a beautiful wife of my colleague and see the same eros of her towards me, so that nothing is there to block our prospect of mutual romantic-sexual rejoicing in a secret date, and I am completely carried away by this powerful drive, to the extent that even the idea of not having such a date seems terrifyingly appalling to me, then only the Activity of God's wisdom and commandment in my heart can stop this irresistible drive - like in Psalm 118:13 "I was pushed [by the sinful drive] and about to fall, but the Lord helped me" - and this salvific Activity is called the "word of God". That's why the "word" or "commandment" ἐντολή of God is said to be the "sharpest", and I would add "most venomous", for it poisons and kills all sinful delectations, that are ruinous for soul, just like snake's venom is used against deadly infections in the art of medicine.
Thus, we can say that Jesus Christ, the incarnate Word of God, gives us the Word(s) of God, i.e. His articulable commandments, as well as also the Power to fulfill those commandments, and when He works in us to make His commandments in our hearts - that is to say, His "Word" in us - our existential reality, we can say that "not we but He lives in us" (Gal.2:20), which is the same to say "Logos' word or words/commandments live(s) in us".
SWORD of SPIRIT
Now, why this "word", this graceful-operational presence of God in our hearts is called the "sword of the Spirit"? First of all we should establish the semantics of 'spirit' here, for it can mean a) Holy Spirit as a trinitarian Hypostasis, or b) Spirit as the Holy Trinity's divine essence which is totally spiritual (so as for the expression "sword of Spirit" to be translated as "spiritual sword"), or c) a human soul or human created spirit, for Paul sometimes uses πνεῦμα in this sense also (cf. 1 Cor. 14:14 /"my spirit prays"/). All three are possible. The b) and c) variants are easy to interpret: b) The action of God in us, His graceful presence in us is a "spiritual sword", for exactly divine action in us repels and kills the influence of sinful passions in us; and c) If we want to overcome the demons' and sin's influence on us, our spirit/soul/personality should ask God for not removing His graceful presence from us, for only through this presence can our spirit be rescued from a defeat and subjugation to the sweet drive of sin, and that's why it can be called as "sword of our spirit".
But what if the a) option is the one Paul had in mind? This is most difficult and I will timidly try to hazard this explanation: there might be some causality or sequentiality here: we have to first receive Holy Spirit in order to understand the full meaning and intent of the Lord's words/commandments (John 16:12-15), and thus, Lord's words so understood in the light of the Holy Spirit, will indeed become "Sword of the Holy Spirit", that is to say, caused by and preceded by acceptance and presence of the Holy Spirit in us. Otherwise, without the enlightening effect of the Holy Spirit the same words of the Lord can be understood pervertedly, and a man can amputate his hand by an axe really after hearing from the Lord "it is better to cut one's hand and enter heavenly Kingdom one-handed" (Matthew 5:30), and the word of God so understood, that is to say, without enlightenment of the Holy Spirit, will not be a "sword of the Spirit", but an "axe of idiocy", as a matter of fact.