.doc or .docx viewer

.doc or .docx viewer

Hi ,
I have a word document file on the server (physical location) and on a button click i have to show the file as a preview with the same formatting .Do we have any extension to do this.
Please help.
Hi Pramod,

I don't think there is but It certainly would be a great addition to our forge. Why do you give it a try to create it?

Here's a link that might be helpful. http://social.msdn.microsoft.com/Forums/vstudio/en-US/80030ed2-54de-4c7b-82a4-ab39677fb4fa/creating-a-thumbnail-from-a-word-document?forum=csharpgeneral
I think the best solution for this would be to use the Filesystem extension to get the file and use a download node for showing the file to the browser.

Just let the browser open and handle the file.
Hi Recardo,
Please see the code (do you think this should work)

public void ProcessRequest(HttpContext context)
            String sFullPath = String.Empty;
            sFullPath = context.Request.QueryString["FullPath"];
            if (sFullPath != null && sFullPath.Length > 4)
                if (sFullPath.Contains(@"\"))
                        FileInfo _fileInfo = new FileInfo(sFullPath);
                        if (_fileInfo.Exists)
                            // Clear the whatever
                            context.Response.Buffer = false;
                            String sContentType = "";
                            // Determine the content type
                            switch (_fileInfo.Extension.ToLower())
                                case ".dwf":
                                    sContentType = "Application/x-dwf";
                                case ".pdf":
                                    sContentType = "Application/pdf";
                                case ".doc":
                                    sContentType = "Application/vnd.ms-word";
                                case ".ppt":
                                case ".pps":
                                    sContentType = "Application/vnd.ms-powerpoint";
                                case ".xls":
                                    sContentType = "Application/vnd.ms-excel";
                                    // Catch-all content type, let the browser figure it out
                                    sContentType = "Application/octet-stream";
                            // Set the headers ??? don't ask
                            context.Response.AddHeader("Content-Disposition", "filename=" + _fileInfo.Name);
                            context.Response.AddHeader("Content-Length", _fileInfo.Length.ToString());
                            // Set the content type
                            context.Response.ContentType = sContentType;
                            // Write the file to the browser
                    catch (Exception ex)
Why not use the download widget in Service Studio instead of all that?

It's probably not a good idea to manipulate HttpContext in an extension as the OutSystems Platform will do a lot of that for you, and what you do there might interfere with the OutSystems Platform.
I have never use this download widget ..if you could give some idea will help me ...
Thanks in advance..
If what you want is to download the document, then put the button on the page and bind it to a screen action. Replace the end node with the download widget. (Press F1 on the widget for help)
You'll need to get the binary of the file to pass it to the download widget. Be sure to get it from the database you should not load the binary to the page, this would have high impact on performance.

You can find help on the Download widget here .

In attachment you can find a skeleton example of what you would need to do in your screen. It doesn't actually fetch the file from disk, but you can use the Filesystem extension for that (just fill in the GetFileContent action).

Let me know if you are still having questions about this.