Create a desktop app that generate ms word file - ms-word

I'm now working with tons of MS Word files and trying to find a way in improving my workflow.
I'm wondering if there's a way to create a desktop app which can preview certain parts from a Word file, select them and generate a new one with controls in Word's text style, paragraph, etc.
I supposed that this would take MS Word API and some frame structure particularly. I've been using Electron/node.js to create some cross platform applications, wondering if it can do as well? Or is there any reference that I can dig in?
Sorry if this sounds like a rookie one. I've tried to search but still can't find out where to start.

There are three possible ways to get the job done:
Automate MS Word to get job done. See Automate MS Office Applications using Python win32com module for more information. For example:
import win32com.client
word = win32com.client.Dispatch("Word.Application")
Use the Open XML SDK for generating Word documents at runtime, see Welcome to the Open XML SDK 2.5 for Office for more information.
Use third-party components.

If you are on Windows, there seem to be some way to access Word files in Python: https://www.blog.pythonlibrary.org/2010/07/16/python-and-microsoft-office-using-pywin32/. Maybe in node too.

Related

Import autocorrect library from word to google doc

I'm planning to switch from Microsoft Word to Google Docs since it has better collaboration options. However, I have set up an extensive auto-correct library in Microsoft Word over the course of 3 years. If I switch to Docs now, I'll have to set them up all over again. A rather daunting task.
I found out that all the auto-correct entries in Word are stored in a file called MSO1033.acl, but I can't find anything that would help me import the auto-correct library from it to Google Docs. Any idea?
The question was about Word's AutoCorrect entries, not custom dictionaries. Although the suggestion to use Auto Hotkey or Selenium still applies.
This is obviously a two-step process: 1) export from Word, 2) Import into Google Docs --> Tools --> Preferences.
1) EXPORT:
Earlier versions of MS Office shipped with a support.dot file that contained various macros, including one for backing up and restoring AutoCorrect entries. While it is very old (c. 2000 I think) it still works and is still available from various sources if you search for it.
This will allow you to extract the AutoCorrect entries into a word document, which can then be saved as a .txt file or whatever.
2) IMPORT - The Missing Link!
There does not seem to exist at the moment a script to import new spelling corrections into Docs. So someone needs to write it. As the proud owner of 22,000 Word AutoCorrect entries who is now a Google Docs fan I'd do this myself!
Except that https://developers.google.com/apps-script/reference/document/ doesn't seem to provide an API for Tools-->Preferences, which makes what should be a straightforward task quite tricky.
Custom Dictionaries in Word
Your custom dictionaries are stored by Word in *.dic files. There files are plaintext files where each entry is in a separate row.
The custom dictionaries are stored at various locations within your user profile:
%APPDATA%\Microsoft\Office\15.0\\Proofing\RoamingCustom.dic
%APPDATA%\Microsoft\Spelling\\default.dic
%APPDATA%\Microsoft\UProof\CUSTOM.DIC
You can see all custom dictionaries via File -> Options -> Proofing -> Custom Dictionaries...
Manually Importing to Google Docs
There is no direct way to import a list of Word (i.e. a Microsoft Word custom dictionary) into Google Docs. Google Docs provides an interface for adding single Word to a (single) custom dictionary. To access the interface open a document and select Personal Dictionary... from the Tools menu:
If you only have to add a few entries, manually entering the words is probably the fastest way to transfer your dictionaries.
Automatically Importing to Google Docs
If you have a lot of words in your custom dictionaries, you can automate your browser, e.g. using a tool such as AutoHotKey or Selenium.

Saving document to server in Java

We have an existing web application written in Java. We want to give our users the ability to open a Word document that is stored in our application on the server. So when the user downloads the document from our server, Word pops up and they then can edit this document on the client. Once finished editing the document we would like to give them the ability to save this document automatically back to the server where they retrieved it, by simply selecting on the Word Save icon. Similar to how SharePoint does it.
Seems to me SharePoint would be a good solution for this and they do it very well, but unfortunately we cannot use SharePoint in our architecture.
There also seems to be a lot of server-side possibilities that we can use to upload and open word documents from our server, I feel we can solve these use cases easily.
My big problem is the automatic saving of an edited document by the client back to our server where the document was downloaded
I am not Microsoft proficient to know what the best solution would be.
Should we write a Word AddIn to save to our server?
How do we get the Word AddIn into our users desktops?
Can we embed a Word AddIn into the Word document that is opened on the client?
1.Should we write a Word AddIn to save to our server?
If you don't want to use SharePoint you can develop an add-in where you can implement all the required functionality and much more.
2.How do we get the Word AddIn into our users desktops?
You can develop an installer for the add-in. See Deploying an Office Solution for more information. Also you can use the group policy objects for deploying the software automatically.
3.Can we embed a Word AddIn into the Word document that is opened on the client?
You can develop a document-level add-in, i.e. the code will be run for a specific document only. But you will need to install it as an application level add-in. See Architecture of Document-Level Customizations for more information.

Building an automated script to copy a page of text, translate it in Google Translator and paste it in Word

So, as the title says, I would like to make an automated script that is going to take all the text from one PDF page, copy it, paste it into Google Translate and then copy the translated text into another Microsoft Word document.
Since that PDF has a lot of pages (150+), I thought it may be easier to make an automated script to do that.
What language would I have to use, would it be complicated for me to do it and in the end, will I actually save time by using this script (implying that I have to learn it first, but I have some programming experience (I know C++, Javascript, PHP), but I do not have a strong grasp of algorithms (like Flood Fill, ...))?
Thanks in advance!
EDIT : I found that I could use AutoIt for scripting... but I don't know would I be better off using AutoIt or Powershell... I also want to learn something that would be enable me to create other scripts (for example to automate some processes I do in Camtasia Studio)... So, AutoIt or Powershell?
As an AutoIt user I would say AutoIt.
Copying text out of PDFs is not quite as simple as you might imagine. Mileage will vary on how the PDF was created, and there are several methods you can use:
Most PDFs will have most of the text in the file itself, allowing you to get the text using a simple method like this
This method uses zlib to do something to the pdf. Not sure what as I've never tried it.
There are a variety of examples of using third party programs to do this, which may be better. There is one using Debenu and another using XPDF
Automating other programs such as acrobat should be possible, in acrobats case they have an api that can be used, though I'm not aware of this already being wrapped in AutoIt.
As to the rest of the requirements, there is a UDF to translate with google translate here, and the word UDF is a standard one that comes with the AutoIt installation.

How to create a Word-like document (.docx) in an app?

I would like to create a .docx file within an iPad application. The file would be created within the app (the user would create/edit it like in Word--preferably with the same "feel" of Word) and then it would be saved as a .docx file.
So, is it possible to do this? If so, how? What other alternative file formats are there?
Thanks,
John
You can easily generate RTF corresponding to most typical features of a word processor. It will not cover the vastness of available DOCX features, but I'm not certain a complete port of Microsoft Word to the iPhone would be practical, so most of these features would be unavailable anyway.
RTF is fully (read-write) supported by Microsoft Office and several other editors.

Convert Word 6.0 to Word 2003 programatically

With the latest security update from MS
Security
Existing word templates documents could not be loaded and they started throwing exceptions each time we load.
We would like to convert the existing Word 6.0 to Word 2003 programmatically or by using a tool.
How do we convert using .NET? Or any existing MS Tool
Thanks for the help
I'd start with here on how to programmatically hit Word's object model. Once you get that down, it should be a simple matter of writing a program to get Word to open a file and then perform a "Save As" for every file you have.
your other option is to use OpenOffice in a scripted way.