Change fields depending on drop down selection in Microsoft Word design mode - ms-word

Can anyone point me to info about how to create a Microsoft Word document that changes text input fields depending on what the user selects in a drop-down menu?
I'm using Word, Developer toolbar, Design mode, and have gotten as far as how to create the drop down selection box, and add text input fields below that on the page, but I need to know how to change what fields appear depending on what the selection is. I'm sure it's possible, I just don't know how to go about it.
I'm pretty good with this sort of thing in HTML with javascript and jQuery, but Word is its own little world.
I tried the "structured" tab but it suggests selecting XML add ins, and none appear in the list to select.

One option is using a template approach in combination with 3rd party toolkit and external application. External application takes care for user interface where user selects template and sets filter for data retrieval. The application then reads the data, generates new document based on template and populates it with data.
You don’t have to mess with MS Word macros and this solution can survive Office upgrades very smoothly.
Template design in done in MS Word. We are using third party toolkit (i.e. Docentric Toolkit) for populating Word documents with data.

Related

Is it possible to embed form inputs into a rich text editor document model?

I am building a project with Django 2.2.4 and PostgreSQL 11.4. I am using JSON database fields to store data in JSON arrays.
In my app users create documents using "rich text editor" that provides standard text/image features already.
I also want to enable users create the document to drag and drop form inputs into the body of the document so that once the document is "published" other users can view the document an add input values to these fields before submitting and saving the document again.
Now, I'm trying to figure out conceptually the most efficient way to approach this.
I thought the first step would be to use an abstracted rich text editor which separates the document structure from the HTML, e.g. CKEditor or Quill; if I was to serialise the document with form inputs included I could in theory store templates in one JSONField and inputs in another.
This list is a really useful overview of various editors, but despite having read a lot of documentation it's not clear if this approach would be either correct or actually possible.
Does anyone have any similar experiences?
Pretty sure this isn't possible unfortunately.
Could you elaborate on what you're trying to do with this?

Persisting data in word document using office add-in

I'm trying to develop word add-in which allows to modify word content. One of the requirement is to select some text and mark it:
change its style (look) - and that is done
Associate that piece of text with some custom/hidden data, ex. an ID.
I want to somehow persist that data within the document, so that:
My add-in can read the document on the start and build a list of 'marked' elements
It should work on different machines - I can create a document on one machine, later open in on other machine, and add-in should be able to retrieve that data.
So far I tried to persist that data by first, getting data as HTML, and add attributes to tags, but that didn't work.
Also tried to add some hidden div, but it was only available during word app lifetime.
Recently, found this link: https://github.com/OfficeDev/Excel-Add-in-JavaScript-PersistCustomSettings , but still it allows to persist data in scope of "browser", so, I assume that on other machine it won't work.
What are my possibilities? Maybe I shouldn't store it within a document, but if not, where?
Developing it using office-js - it should work for both Word 2013 and Word 2016 (so I don't have an access to Word 2016 specific API).
Check out https://dev.office.com/reference/add-ins/shared/settings
The Office JS Settings object allows you to save custom data that persists with the document. It is pretty straight-forward to use. Getting settings is synchronous - saving settings is async. The biggest thing is that you have to remember to call Office.settings.saveAsync() after you have made your changes using Office.settings.set() in order to actually save the changes to the document.
Moreover to Nick's answer which is absolutely correct, you can use "Binding" mechanism.
Bindings are stored in document out-of-the-box, so that, you can access those later at any time.
An example, which fits my needs:
Select some text and click on button in add-in (to call some method)
Call addFromSelectionAsync() method (you can specify an id for it to reference it later)
Access it using getAllAsync() or getByIdAsync() method at any time you need it.
More about it: https://dev.office.com/docs/add-ins/develop/bind-to-regions-in-a-document-or-spreadsheet

MS Word - Possible to Add Embedded Document?

I'm in the process of exploring the possibilities of Word VSTO add-in. Using a combination of custom task pane(s), a custom ribbon and a series of dialog boxes or forms I can collection information from the user. However, what I can figure out is where I can persist this information within the document. A docx is made of a series of individual files, how do I add my file within the cab as well? Storing the custom info outside of the document is not an option, it must travel with the document itself.
Thanks,
Update : If I use custom xml parts per the solution mentioned here https://msdn.microsoft.com/en-us/library/bb608612.aspx then it appears to me that the xml data is visible to the user. See screen shot. The user should not be able to browse data that my add-in is storeing - not because it's senstitive but because it makes no sense for them to see and interact with a bunch of serialized class data.
You can store your custom information inside the document using so called Custom XML Parts. This information is stored within the document.
Here is an example how to add a Custom XML Part to your document:
How to: Add Custom XML Parts to Documents by Using VSTO Add-Ins

Space length limitation

I have a word document file which is a form.
I try to complete it. Here is a screenshot of how it is looks like
When I type in the grey box there is a limitation in length and when I reach it, it won't let me type more.
I am not sure of what it is, however I want to insert an image or a table but I can't.
How can I make it?
The field you are trying to enter information into is a Legacy Text Form Field in Word 2010. In order to have a data entry area within the form that will accept text, tables, and images, delete this field and replace it with a Rich Text Content Control. This control is found on Word's Developer Tab:
Instructions for Displaying Word Developer Tab (if needed)
Like the legacy form fields, content controls allow manual or programmatic entry of data as well the ability to restrict editing of the data within the content control. Gregory K. Maxey has posted an incredibly detailed tutorial on creating forms with content controls, programming the content entry via VBA (Visual Basic for Applications) and restricting editing of the control's contents (all of which is available using the Rich Text Content Control):
Create Forms with Content Controls by Gregory K. Maxey
The same author also has an additional posting on content controls where he provides links to and offers explanations of more advanced content control abilities such as data mapping:
Content Controls (Additional Information) by Gregory K. Maxey
Lastly, Microsoft also provides some guidance on programming content controls via .NET (which I think may be beyond the scope of your question, but which I include for future readers):
MSDN: How to Add Content Controls to Word Documents

Interactive PDF Creation Alternatives to Acrobat?

Are there any good alternatives to Adobe Acrobat for creating interactive PDFs? The terminology is a little fuzzy here - by interactive, I mean "able to be filled in", and not necessarily "scriptable". So this form would be for data collection, rather than report generation which seems to be the common scenario for pdf-related questions on SO.
The trick is that they need to be fillable using Adobe Reader. For those who have not experienced the many frustrations of Acrobat - by default, Reader cannot fill in a form unless it was created using Acrobat Pro >8.0 and has specifically enabled usage rights. That's fine and it basically works (except then Pro users can't save their data - WTF?).
Because I am getting frustrated, I would ideally like to avoid Adobe products altogether (that is on the design side, for the users Reader is still a necessity or I would just do it as a db-backed web form). I'm wondering if anyone has has good experiences with alternatives? Either software libraries or products?
Thanks!
EDIT - Thanks, matt b - I'd seen iText before but didn't know it could create forms. Unfortunately, it looks like Reader cannot save filled-in data to the forms generated by iText (or generated by OO Writer). I've got the nasty feeling that what I want is fundamentally impossible except using Adobe's own rights management tools. If there are other ideas. I'd love to hear them.
You can create fillable form PDFs using OpenOffice.org as well as LibreOffice.
To create the initial form elements in the *.odt documents, enable the View --> Toolbars --> Form Controls tools, which allow you to add clickable checkboxes + radiobuttons, fillable text fields, pushbuttons and some more to the page(s).
When you're finished with your document, use File --> Export as PDF with the checkbox Create PDF form enabled.
Now your PDF form will be editable (and saveable!) with any non-Adobe PDF viewer.
NOTE, however: Adobe uses an own proprietary way to create and fill PDF forms. Adobe Reader does only support to fill PDF forms which were created by an Adobe product (and which have been assigned 'extended rights' so Reader can indeed save the formdata alongside the document).
Adobe Reader will not work with PDF forms you created with OpenOffice.org or LibreOffice ('work' in the sense of: 'allows you to fill+save the form data'.). The technical mechanism behind this is that Adobe digitally sign their form documents with their own key (which is known to the Adobe Reader, and which you agreed to not reverse engineer when you accepted the Adobe Reader EULA...). --
This means:
Non-Adobe PDF Readers will not be able to 'fill+save' forms created with Adobe products (they can 'fill+print' them however).
Adobe PDF readers will refuse to 'fill+save' forms created with non-Adobe products (they will 'fill+print' them however).
The latter two points will be true for all the tools and utilities mentioned in the other answers to this question. If I'm mistaken here, please let me know in a comment...
iText is pretty much the standard in the java-world for generating PDF files programmatically. Perhaps it can also be used to create PDFs with forms in them as you would like?
The open source page layout tool Scribus has a bunch of features oriented to creating interactive PDF forms. I haven't personally used them, but they appear reasonably complete and are covered by the tutorial.
Scribus is worth knowing about if you ever need to do serious page layout in any case.
XSL FO is some thing we used to create PDF files out of existing form data. Unless you want the fillable pdf to be sent out the client, this is a valid option.
IText lets you create Annotations (there are essentially 3 types of 'interactive' components - forms (old style FDF and new XFA) and Annotations. Acrobat and lots of third party tools should let you modify the Annotations values.
There is also a DotNet version of IText called ISharp - both are freeand extremely powerful.
CutePDF Pro allows you to turn a PDF into an interactive form.
Foxit reader allows you to save any pdf with the filled in fields.
I recently dabbled with Scribus. I found it to be an excellent tool if one has enough time to configure and play around with it. I highly recommend it. Wufoo is also very good.
I am not a fan of Acrobat / Adobe. A software should make my life easier not challenge me at every step.
If you search the net with these keywords - FREE FORM CREATOR and you can add the word HTML5.
You will find an array of sites where you can log online and all your clients can have their separate login, fill in data and the form remains in the Cloud and declutter your hard drive. All stakeholders can access the form and edit at anytime. The account can be used as a folder for your business. These forms can be accessed on any device and any platform.
Many of these forms are HTML5 driven, they are so beautiful and fluid. Keep away from macros, they carry viruses.
www.homebasedofficeservices.com