/    Sign up×
Community /Pin to ProfileBookmark

Saving contents of TextArea to a word doc

Hi All,

After lot of hits and misses i have turned to this forum. ?
I have a very simple JSF Portlet.
It has a simple textarea and two buttons.(Print and Save As).
On the click of the Save button i want the contents of the TextArea to be save to as a Word Doc.
The approach i tried using is :
popup.document.execCommand(“SaveAs”,true,”Default.doc”);

But it has two disadvantages:
a)When the “Save Dialog” appears the “Save as type” by default is “html or text” but not “Word Document”.

How can i convert the contents of html in textarea to purely word format?

b) Second exceCommand() it supported only by IE but not other browsers.
Please suggest me how could i make it support other browsers.

Are the above mentioned actions supported by JavaScript.
I am eagerly waiting for your suggestions.

Best Regards,
Pals.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERNov 17.2006 — What's wrong with: ?

1. Open 'WORD'

2. Copy <textarea> information into clip-board

3. Paste clipboard to word application.

4. Save as .doc file.

More steps, but it would work.

Also, 'Word' can read a text file, not just .doc files
×

Success!

Help @pallavr spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...