Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-12-15 15:15:34

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Save as Word document

Yo check out my first attempt at saving the contents of Xinha as a Word document.

http://www.eccovogels.nl/xinha/

Offline

#2 2005-12-15 17:18:40

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Save as Word document

nice idea. you should make a plugin out of this

Offline

#3 2005-12-16 08:41:39

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Save as Word document

Cool! Xinha doesn't seem too work in IE, though. I saw something once about how to create RTF files that made me think that Xinha could do it with some kind of RegEx plugin like GetHtml  http://www.phpinsider.com/smarty-forum/ … php?t=2049 but this is much better.

I wonder if it's possible to support images.

Offline

#4 2005-12-16 09:34:10

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Save as Word document

Images could be packed into one MIME multipart file.  Like e-mails. "Multipurpose Internet Mail Extension HTML" is the keyword

Offline

#5 2005-12-17 05:37:25

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Save as Word document

The example just worked perfectly for me in IE, except the popup didn't close after I pressed the button.

Offline

#6 2005-12-17 14:15:05

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: Save as Word document

I wouldn't know how to close that window. I am not much of a javascript-programmer, I just "saw the way" and grabbed some stuff together.

Images loaded into Xinha with the Image Manager work fine in Word I believe.

It would be nice if we could know which styles, if any, are loaded. Then we could copy them to the Word-document.

And it would be nice to know how to close the popup after we submitted the form and started the download smile

Offline

#7 2005-12-18 02:26:59

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Save as Word document

Actually, after playing around trying to find what the minimal changes required are to make an HTML file behave like a Word doc, I've found that I can change the extension on any HTML file to .doc, and then it opens in Word and lets me edit it. Fascinating.

Offline

#8 2005-12-18 06:32:54

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: Save as Word document

This is the article in which I found the <head> I used.

http://pixelated-dreams.com/pages/dynam … _docs.html

Offline

#9 2005-12-22 02:53:43

Subha
New member
Registered: 2005-09-23
Posts: 3

Re: Save as Word document

iframe zoom is not working in firefox browser? Can anyone help?

Offline

#10 2005-12-22 02:54:44

Subha
New member
Registered: 2005-09-23
Posts: 3

Re: Save as Word document

overwrite is not working in firefox browser? Please help me?

Offline

#11 2005-12-22 02:55:46

Subha
New member
Registered: 2005-09-23
Posts: 3

Re: Save as Word document

images are displaying with absolute paths in firefox. can anyone help?

Offline

#12 2005-12-23 00:08:24

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Save as Word document

Ecco, I think it's great, are you going to create a plugin?

Offline

#13 2005-12-23 00:41:54

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Save as Word document

Subha, you should click on the Post New Topic link at the top of User Discussion & Help and create topics for your questions.

Then, someone familiar with your problem may see the name of your topic, read your question, and help you.  smile

Offline

#14 2005-12-25 07:57:04

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: Save as Word document

mharrisonline wrote:

Ecco, I think it's great, are you going to create a plugin?

I'm afraid I can't, Mr Harrissonline. My javascript-skills aren't sufficient - yet ;-)

Offline

#15 2006-02-06 15:11:26

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: Save as Word document

Using this code I'd hoped to be able to load Word documents into Xinha, but all I get is plain text. Perhaps someone could shed some light on this?

Xinha config :

xinha_config.URIs["Word"] = '/forum/word.html';
cfg.btnList["Word"] = [ "Open Word doc", "/forum/word.gif", true, function(e) { xinha_editors.myTextArea._popupDialog(xinha_config.URIs["Word"], null, null); } ];
cfg.toolbar.push(["Word"]);

word.html :

<html>
<head><title>Open Word document</title>
<script language="JavaScript">
<!--//

window.resizeTo(315, 170);

function loadworddoc(){

var doc = new ActiveXObject("Word.Application");
doc.Visible=false;
doc.Documents.Open(document.all.hello.value);
var txt;
txt = doc.Documents(document.all.hello.value).Content;
opener.xinha_editors.myTextArea.setHTML(txt);
doc.quit(0); 
}

//-->

</script>

</head>

<body>
<p><font face=arial size=2>Open a Word-document</font>
<p><input type=file name=hello id="hello">
<p><input type=button onClick="loadworddoc();" value="Load">
</body>
</html>

Offline

#16 2006-02-07 08:13:42

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Save as Word document

My guess is that doc.Documents(document.all.hello.value).Content is returning plain text, you'd  have to find the documentation of the Word ActiveX object and see if you can get it to return HTML which you can then insert.


James Sleeman

Offline

Board footer

Powered by FluxBB