Shaykh al-Islam Ibn Taymiyyah (may Allah have mercy on him) said:
It is permissible to write, using permissible ink, something from the Book of Allah and its invocations for one who has been afflicted (with illness) and others, and then wash it and give it to the ill to drink, as Imam Ahmad and others have mentioned.
`Abdullah bin Ahmad (son of Ahmad bin Hanbal) said, “I read to my father: Ya`la bin `Ubayd narrated to us, that Sufyan narrated to us, from Muhammad bin Abi Layla, from al-Hakam, from Sa`id bin Jubayr, from Ibn `Abbas, who said, ‘If it becomes difficult for the woman to deliver her baby, then write:
In the Name of Allah, there is no deity worthy of worship except Allah, al-Halim (The Forebearing), al-Karim (The Generous), exalted be Allah, Lord of the Mighty Throne, all praise is due to Allah Lord of the worlds,
“The Day they see it, it will be as if they had not remained [in this world] except an afternoon or a morning.” [Al-Nazi`at 79:46]
“On the Day they see that which they are promised, it will be as though they had not remained [in this world] except an hour of a day. [This is] notification. But will any be destroyed except the defiantly disobedient people?” [Al-Ahqaf 46:35]’
My father (Ahmad bin Hanbal) said, ‘Aswad bin `Amir narrated to us with his chain similar in meaning to the above, and said, ‘It should be written and placed in a clean container, and then given to drink.’’ My father said, ‘And Waki` added, ‘She should be given it to drink and some of it should be taken and sprinkled below her naval.’’”
`Abdullah (son of Ahmad bin Hanbal) said, “I have seen my father write for a woman, placing it in a cup or something clean.”
[Majmu` al-Fatawa (19/93-94)]
ذكر عند تعسر الولادة.