doc

How to check if a word file has a password?

懵懂的女人 提交于 2019-12-29 08:29:49
问题 I built a script that converts .doc files to .docx . I have a problem that when the .doc file is password-protected, I can't access it and then the script hangs. I am looking for a way to check if the file has a password before I open it. I using Documents.Open method to open the file. 回答1: If your script hangs on opening the document, the approach outlined in this question might help, only that in PowerShell you'd use a try..catch block instead of On Error Resume Next : $filename = "C:\path

Convert html to doc in java

寵の児 提交于 2019-12-28 06:47:25
问题 I would like to convert either an html or xhtml document (preferably with styles) to Microsoft .doc and/or .docx format. There seem to be plenty of examples for doing this the other way around but I haven't found any useful examples for converting to ms document formats. Can anyone point me to an api or provide an example for doing this please Many thanks 回答1: docx4j 2.8.0 supports converting XHTML documents and fragments to docx content. Disclosure: I wrote some of the code. 回答2: Yet another

轻松实现Word在线编辑

谁都会走 提交于 2019-12-26 13:25:34
原地址: http://blog.joycode.com/kaneboy/archive/2004/11/03/37889.aspx 有朋友询问如何在Web页面上做到像SharePoint中的效果一样,能直接激活客户端的Word来打开.doc文件,而不是类似直接点击.doc文档链接时Word在IE中被打开那样。想想这个问题应该很多人都会感兴趣,所以干脆写一篇blog来大致描述一下方法。 在安装Office2003以后,有一个ActiveX控件被安装到了系统中,这个控件位于“Program Files\Microsoft Office\OFFICE11\owssupp.dll”。通过这个控件,客户端页面上的JavaScript就可以激活本地的Office软件,来实现打开、编辑Office文档。(另,Office XP应该就已经包含这个ActiveX控件了。) 首先,用Script创建一个本地的对象: openDocObj = new ActiveXObject("SharePoint.OpenDocuments.2"); // 为了兼容Office XP,可以创建“SharePoint.OpenDocuments.1” 然后,调用openDocObj的相应的方法。比如打开服务器上的一个Office文档: openDocObj.ViewDocument(" http://www.abc

Javascript Blob document with html tags to be saved with formatting

て烟熏妆下的殇ゞ 提交于 2019-12-24 16:27:57
问题 I am having some text like below to be saved in a downloadable doc format using javascript blob. <p style='font-size:18px'>Hello</p> Once the download happens I want the doc to show just show formatted ' Hello ' without any html tags. In ubuntu this works very well. But when I open the same doc in windows or google docs , I still see html tags. Is there a way where I can do this formatting at Blob level itself. Below is the way Iam creating blob object. var file = new Blob([val], {type:

When creating a DOC or Excel file using the LUA language, Russian characters are not displayed correctly

时间秒杀一切 提交于 2019-12-24 07:59:05
问题 My code works, but instead of Russian characters incomprehensible characters are displayed. My code: local fileName = "myfile3.doc" local FileWrite FileWrite = io.open(fileName, "w") FileWrite:write("фывф", '\n') FileWrite:close() or require('luacom') excel = luacom.CreateObject("Excel.Application") excel.Visible = true wb = excel.Workbooks:Add() ws = wb.Worksheets(1) for i=1, 10 do ws.Cells(i,1).Value2 = "фывф" end 回答1: It works for me exactly as written. I used UTF-8 encoding for the file

Why doc and docx losing style information in iOS?

人走茶凉 提交于 2019-12-24 06:37:40
问题 I wanted to open a docx, doc file in iOS. I tried two ways: 1.Web view 2.QLPreviewController In both the ways I am losing the style information associated with the document. WHy this happens? Is in any way possible to retain the style information. Is there any way we can retain this information? The Style could be: A table in document - displayed with doc format but not with docx format Particular text in the document alone can be hightlighted with a color 回答1: iOS has support for MS Office

Convert DOC to PDF [closed]

依然范特西╮ 提交于 2019-12-24 00:58:38
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I know this question has been asked over and over, but I can't find the answer I'm looking for. So I'll shamelessly try again. I'm

js小结

删除回忆录丶 提交于 2019-12-23 23:26:29
注意大小写一定不能弄错. 属性: 1Attributes 存储节点的属性列表(只读) 2childNodes 存储节点的子节点列表(只读) 3dataType 返回此节点的数据类型 4Definition 以DTD或XML模式给出的节点的定义(只读) 5Doctype 指定文档类型节点(只读) 6documentElement 返回文档的根元素(可读写) 7firstChild 返回当前节点的第一个子节点(只读) 8Implementation 返回XMLDOMImplementation对象 9lastChild 返回当前节点最后一个子节点(只读) 10nextSibling 返回当前节点的下一个兄弟节点(只读) 11nodeName 返回节点的名字(只读) 12nodeType 返回节点的类型(只读) 13nodeTypedValue 存储节点值(可读写) 14nodeValue 返回节点的文本(可读写) 15ownerDocument 返回包含此节点的根文档(只读) 16parentNode 返回父节点(只读) 17Parsed 返回此节点及其子节点是否已经被解析(只读) 18Prefix 返回名称空间前缀(只读) 19preserveWhiteSpace 指定是否保留空白(可读写) 20previousSibling 返回此节点的前一个兄弟节点(只读) 21Text

How to read or copy text from .docx/.odt/.doc files

≯℡__Kan透↙ 提交于 2019-12-23 17:51:02
问题 In my application, I want to read a document file (.doc or .odt or .docx) and store that text in a string. For that, I am using the code below: string text; using (var streamReader = new StreamReader(@"D:\Sample\Demo.docx", System.Text.Encoding.UTF8)) { text = streamReader.ReadToEnd(); } But I am unable to read or copy proper text, as it shows like: PK�����!��x%���E���[Content_Types].xml �(��������������������������������������������������������������������������������������������������������

Having trouble using Python and LibreOffice to convert pdf to docx and doc to docx

笑着哭i 提交于 2019-12-23 03:19:09
问题 I have spent a good amount of time trying to determine what is going wrong exactly, with the code I am using to convert pdf to docx (and doc to docx) using LibreOffice. I have used both the windows run interface to test-run some of the code I have found to be relevant, and have tried on python as well, neither of which works. I have LibreOffice v6.0.2 installed on windows. I have been using variations of this code to attempt to convert some pdfs to docx of which the specific pdf file is not