The Apostle Paul makes the first logical connection of Jesus as the "Word" through references to the Book of Deuteronomy.
Romans 10:5-9 (NASB)
5 For Moses writes that the man who practices the righteousness which is based on law shall live by that righteousness. 6 But the righteousness based on faith speaks as follows: “Do not say in your heart, ‘Who will ascend into heaven?’ (that is, to bring Christ down), 7 or ‘Who will descend into the abyss?’ (that is, to bring Christ up from the dead).” 8 But what does it say? “The word is near you, in your mouth and in your heart”—that is, the word of faith which we are preaching, 9 that if you confess with your mouth Jesus as Lord, and believe in your heart that God raised Him from the dead, you will be saved;
Paul is quoting from Deuteronomy 30:11-14 (LXX coincides with MT), and therefore makes Jesus to be synonymous with the "Word of God" from heaven that (who) saves. So the "Word" is both the special revelation from Moses (Word of God) and the Person who descends from heaven and then ascends (Word of God). Later in Eph 4:8-10 Paul expounds on the particulars of the descending of Jesus from heaven from an allusion found in Psalm 68:18 (LXX coincides with MT). That is, Psalm 68:18 does not mention any descent; thus the correlation to Deuteronomy 30:11-14, which refers to the ascent of the "Word" to heaven.
Secondly, the Apostle John then takes the same concept and expounds that the Word of God from heaven became flesh. (The incarnation of the Word would be the "descent" to which Paul was alluding.)
John 1:1; 14 (NASB)
1 In the beginning was the Word, and the Word was with God, and the Word was God. . . 14 And the Word became flesh, and dwelt among us, and we saw His glory, glory as of the only begotten from the Father, full of grace and truth.
So, between the Apostle Paul and the Apostle John, we see the connection between the "Word" from heaven and the Person of Jesus, who descended to earth and was robed in flesh (and who of course then subsequently ascended to heaven). Of course the Law of Moses is the Word of God, but Paul also included the Person as the Word of God as just noted in Romans 10:5-9.
Now the passage in question (Hebrews 4:12-13) plays on the word λόγος, which occurs twice in the passage. In other words, the first occurrence refers to Scripture, and the second occurrence refers to our response to Jesus Christ by faith.
Hebrews 4:12-13 (GNT)
12 Ζῶν γὰρ ὁ λόγος τοῦ θεοῦ καὶ ἐνεργὴς καὶ τομώτερος ὑπὲρ πᾶσαν μάχαιραν δίστομον καὶ διϊκνούμενος ἄχρι μερισμοῦ ψυχῆς καὶ πνεύματος, ἁρμῶν τε καὶ μυελῶν, καὶ κριτικὸς ἐνθυμήσεων καὶ ἐννοιῶν καρδίας: 13 καὶ οὐκ ἔστιν κτίσις ἀφανὴς ἐνώπιον αὐτοῦ, πάντα δὲ γυμνὰ καὶ τετραχηλισμένα τοῖς ὀφθαλμοῖς αὐτοῦ, πρὸς ὃν ἡμῖν ὁ λόγος.
The literal translation of the last clause is: "But everything is laid out bare and naked before the eyes of Him, to whom is our λόγος (account). In this regard, most modern translations state: "...before whom we have to do."
However, there is a nuance in Greek: that is, the λόγος (Scripture) not only cuts deep, but our λόγος (account) will depend on how we respond to Jesus Christ by faith. In other words, our relationship to the λόγος (incarnate Word) will be the determining factor in the day of judgment.