Is there a way in (DocumentFormat.OpenXml.Wordprocessing) to write protect a paragraph? - ms-word

I understand you can protect the whole document with something like this: myDocument.ExtendedFilePropertiesPart.Properties.DocumentSecurity= new DocumentSecurity("4");
Is there a way to do the same, but to just a single paragraph ?
-thanks in advance

Yes, although I'm on a mobile device and can't check the exact syntax at the moment. But you can find it, yourself.
Start a new document, fairly simple content. In the Word application go to the Developer tab. There's a group/button "Restrict Editing" / "Protect document" (depending on the version of Word). That displays a task pane where you can define the kind of restriction. Select everything BUT the paragraph, then from Step 2 choose "Read-only" (or something like that - not protect for comments or form fields). Make the selection editable for "everyone". In the next step, activate the protection.
Once you have this working, open the document in the Open XML SDK Productivity Tool and you can inspect the underlying Word Open XML syntax. Plus, if you're using the SDK (that's not clear from your question) it will also show you the code for generating the document.

Related

Is there an easy way to search Snippets in SQL Developer?

I find that my collection of snippets has grown far beyond what can be managed by assigning a Category and Name. "I know I wrote this code before, it's probably in one of these three categories but it definitely hit table T and used function F; should my time be spent clicking thru each likely category and dragging out each snippet, reinventing it, or searching the snippets.xml?" is a conversation I have with myself far too often.
I tend to copy the snippet body into the tag so I can hover and see some of what's in there but still, being able to actually search the snippets (like we can do with SQL History) would be amazing. Is there a way?
No, there is no way today.
I'm happy to log an enhancement request on your behalf for that feature.
In the meantime, maybe consider trying the Code Templates instead?
You can 'search' either by the name of your code template, or by the first word of the code template 'source'
type the word, and then ctrl+enter to bring up the list of 'hits'

MS Word Personal Templates

I'm working with MS Word and am trying to create a list of customized template(s).
i.e. Open Word (2013 / 2016), in the 'New' menu you'll see a list of "Featured" templates, I would like to add my own list of templates.
Through research (Handy Blog), I've learnt that you can create a new template and add it to the "Personal" templates. My problem is, I'd like it to be my own name - instead of Personal, I'd like to have my own heading, say MyCustomTemplates.
From some further reading, I've read a few mixed opinions from this and some even saying that it is impossible, as these 'headings' are hard-coded (Office Forum)
Graphical explanation:
Doing this manually will be my first step, from there - I'll be adding these templates programmatically.
To help anyone that comes across this - below are my findings (including some really useful forums and feedback) and the solution I am most likely going to go with;
After tons of research I have noted and got confirmation that, to change the name of either of the Word headings (FEATURED, PERSONAL etc.) is not possible - Office have hard coded these - see this thread.
You do have some options though:
Using the PERSONAL tab within Word, you could create your own
templates for use (the name would however, remain "PERSONAL") > This
URL will take you through the process, step by step.
If you prefer using a "Support Office URL" - here it is.
As suggested by Doug Robbins, in this thread - you could "Add the New Document or Template command to the Quick Access Toolbar and create a folder under:
C:\Users[User Name]\AppData\Roaming\Microsoft\Templates". This is not ideal for my implementation.
Create an Addin Template using this URL
Use the Ribbon XML, (this is most likely going to be my route): Create a Ribbon XML for the Word application, the user must select this option (click on your ribbon item), then from a folder that you specify, let the user select a template (that you've added) for them to work with. Load the template to the current word document.
I hope this helps.

K2: How may I open a file in a new window unless I already have such a window open?

I have a K2 Smartform that displays a list of file names. When the user clicks a file name, the program opens that file (all of them are PDFs) in a new tab in the browser (IE). This is good so far. If you click on a second file from the list, it opens in a third tab. That is not what the user wants.
They want the second file selection to open in the same window as the first file.
This is the process I can see:
Click on the file in the list.
Open in a tab.
Click on a second file in the list.
If there is already a tab open with a file from the list, open this file there. Otherwise, open a new tab for the file.
I suppose automatically closing the first tab when they click on the second file would accomplish the same thing.
How can this be done?
When you deal with opening links, first of all, what you can do is limited. Indeed, browsers (IE, Chrome, etc...) can be configured by the users to open links in new tabs, windows, etc... and you as form developer cannot change that.
I have made a jsfiddle to reproduce your situation and propose a solution you can test. I don´t guaranty it will work as I use a Mac but I also describe a better solution below.
You can find it here:
https://jsfiddle.net/chevdor/45k40npv/
I guess the first example (#1) is what happens for you at the moment.
Using the 'target' attribute, I tried to implement a solution that may work for you. Click on #2 and #3 and check whether this work.
I cannot test that since I use a Mac.
You can read more about the target attribute here:
http://www.w3schools.com/tags/att_a_target.asp
Another solution that would give you more control is to use an iFrame control. I think it comes in standard with SmartForms now. If not, you can for sure get it from the community site. I recommend you create a new View with this iFrame and define one parameter (string) called "url".
Let´s speak in K2 rules languages :)
"When the parameter changed", "and the parameters is defined", if you 'Transfer data' passing your URL to the iFrame control, it will display your doc. If the user clicks another document, it will update the SAME iFrame. With this solution, no tab will ever be involved.
Please note that it will work great for any document supported by your browser. Some types may require a plugin. Other documents (ie zip, etc..) will NOT appear but be downloaded instead.
I hope this helps.
Best regards,
-chevdor

Filemaker: Getting file input in a form (filemaker pro 6)

How can I create a filemaker form where the user enters some personal details and has to choose multiple files to upload?
I want it to be an equivalent to <input type="file"> in a html form.
Is it possible using filemaker pro 6?
what do you mean by "an equivalent to in a html form." your form can look how ever you want it too look you design the look in layout mode but your not gonna write html to create a form in filemaker if thats what you mean.
not sure if you can do it in filemaker 6 but try this
create a field in your table called "attachments" and make its type a container
create a script from the script menu call it insert picture
3 add these script steps
let me know if that does what you want
Use container fields, which store files. In FM 6 they lacked a lot of the features they have currently, and they had a clunky interface, but it works.
Be careful though; you might run into the 2GB/file FM6 limit (which went away in 7) after a while.
This would be possible, including multi-file selection, in FM7+ with an addition of a plugin, ScriptMaster plugin can be used to display a FileChooser that allows multi-file selection.
I'm not aware of any plugins that can do this in FM6, but take a look at 24U SimpleDialog at least it's FM6 compatible.

Word forms with too many ActiveX checkboxes load slowly

my company's software product has a feature that allows users to generate forms from Word templates. The program auto fills some fields from the SQL database and the user can fill in other data that they desire. So we have a .dotx template that holds the design of the form, and then the user gets the .docx file to fill out when they call it from our program.
The problem we're having is that some of our users have been finding that the forms take an exceptionally long time to open up and then, once open, are so slow to respond (scroll around, etc) that they're unusable. So in my investigations so far, I've found out that the problem systems are one with lower powered CPUs (unfortunately it happens for systems above our system requirements) and the Word forms that cause the problems are ones with large amount of ActiveX style checkboxes on them. I verified that reducing the ActiveX checkboxes fixes the form loading problems.
So I have the following questions about solutions (we're using Word 2007):
1) Is there any way to configure Word, or some other settings, so that there won't be such a strain opening a Word form with lots of ActiveX checkboxes? Any way of speeding up Word's opening?
2) Using Legacy style checkboxes instead of the ActiveX ones makes the forms load fine, but it looks like the user has to double-click the checkbox and change Default Value->Checked. Is there a way to configure it so that they can simply click on the checkbox to tick it? "Legacy Forms" checkbox as a name kind of worries me (Legacy…), does that mean a future version of word at some point wouldn't load the checkboxes because they're "legacy"?
3) Yes, it became clear to me after a little bit of research into solutions that Word is not the tool for the job for forms like I'm describing. InfoPath seems to be exactly what we should have been using all along but unfortunately I wasn't involved in the decision making or development of these forms, just tasked with coming up with a solution.
I'd appreciate answers to any of these, or if anyone has any other ideas for solutions to this problem.
Thanks
I'm about 3 years too late, but if you want a legacy checkbox to act like a checkbox, you have to restrict editing on the document or section. (You can lock just a section, if you want.) Locking--on Word 2010 it's called "Restrict editing"--is an option under either the Developer tab or the Review tab.
If you restrict editing in this way, the user cannot edit the text but can fill in the form field, so if the form field is a checkbox, the user can click the checkbox on or off; if the form field is a text box, the user can fill the text box.
If you choose to lock off just a section, you'll probably want to use continuous section breaks (Page Layout > Breaks > Continuous) and specify which section. (In the space where you choose form editing as your kind of restriction, there's a small link that lets you specify which section or sections are locked.)