How to define custom highlight color? - ms-word

I'm able to highlight text but I'd like to use custom highlight colors. Even if I define custom colors, Word seems to use one of the colors in the default palette that it thinks is closest.
myRange.font.highlightColor = "#ffcc00"; // Should be orange. Comes out red
That color should come out orange but it comes out red.
Any ideas?

Word does not support custom highlight colors - only the traditionl, basic sixteen colors. This is a limitation of the Word application, not the Office JS APIs.
It would be possible to apply custom colors using Shading, however (as in borders and shading).

Here's a work-around to the problem of defining custom highlight colors which I discovered quite some time ago ..
If you paste in highlighted text copied from an application from outside of Word (i.e., highlighted text from an AOL email let's say), you can then:
Use the insertion bar to select and highlight an area of the text you just pasted in
Press the FORMAT PAINTER tool to copy the formatting of the area you've selected. The pointer changes to a PAINTBRUSH icon (with an insertion bar attached)
Move the PAINTBRUSH to the existing Word text that you want to highlight using the new color
Press and hold the mouse button (usually the left button) while selecting the specific text
Release the mouse button to apply the new highlighting and formatting
The applied highlighting will also include any other existing formatting; so you MAY have to change the font or adjust some other feature (i.e., turn on/off bold, italics, underline, etc.) But this is easily accomplished. The point is that you can now have ANY color highlighting that you prefer – this hack absolutely DOES work!
Here's, one last thing – when you save the document (by clicking the OFFICE BUTTON in the upper left corner), I would advise that you first select WORD OPTIONS, then SAVE and check the box next to "Embed fonts in the file" under "Preserve fidelity when sharing this document" (I always uncheck the other two boxes). This is to ensure that before you export or print the document, you may be sure that all the fonts and features have been saved within it.
And for the record, this technique is NOT shading.
The highlighting comes from actual HIGHLIGHTED TEXT copied from a document or application from OUTSIDE of Word. So it has nothing whatsoever to do with Word's shading feature. I've even copied highlighted text from non-dedicated word processing applications, and then pasted the text into Word – where it is then available to apply the copied highlighting to text within the existing Word document.
If you think about it – the fact that Word 2007 permits you to define any THEME color you want clearly shows that one should be able to define ANY desired custom HIGHLIGHTING color as well – besides just the 15 basic colors (and excluding the "no color"). And this work-around proves that this is so. The problem is that the Word application itself does not permit you to accomplish this directly.

Related

Displaying same document in editor twice with different text decorations

I'm currently developing a vscode extension that highlights snippets of text in specific colors. In order to do that I am creating a TextEditorDecorationType with the color and use setDecoration (TextEditor) on the active text editor.
Now I would like to compare two different colors on the same snippet with each other. Therefore I want to have the editor split in half showing the text document twice, on the left side with the old decoration and on the right side with the new decoration, similar to the git source control:
I figured if it is possible in the source control it should be possible anywhere.
Currently I open a second text editor with the same TextDocument and add the new TextEditorDecorationType to it, yet instead I would like to do it as shown above.
I cannot figure out how to split the editor like that displaying the same content twice.

What does text inside a red rectangle in VS Code mean?

What does text inside a red rectangle in VS Code mean?
If I just start typing outside of any file and outside anything (e.g. the Ctrl+P input, or the search input), then I am getting what I typed being added inside a red rectangle. Here is a screenshot of what I mean:
The rectangle appeared in the right upper corner of my opened VS Code when I typed Foo.js. By rectangle I mean the filled one, the red border was added by me manually to highlight the filled rectangle.
I am very curious what is a purpose of this?
The text you get in red rectangle is the search that VScode performs on the version control changes for filename. You can type more to search specific files in you changes list.
You can click on that box to enable or disable filter based on what you typed
This is the document tree filtering feature that appears to have been released in version 1.31, see the Workbench section of the release notes more details.
The current "Getting Started" docs states:
You can type to filter the currently visible files in the File
Explorer. With the focus on the File Explorer start to type part of
the file name you want to match. You will see a filter box in the
top-right of the File Explorer showing what you have typed so far and
matching file names will be highlighted. When you press the cursor
keys to move up and down the file list, it will jump between matching
files or folders.
Hovering over the filter box and selecting Enable Filter on Type will
show only matching files/folders. Use the 'X' Clear button to clear
the filter.

Change NetBeans "DoubleClick Highlighted" Text Background

In NetBeans 7.4.0, when I doubleclick certain words in the code, NetBeans highlights all of them (in my case, in yellow). For the sake of clarity, and hopefully to avoid any kneejerk downvotes, I am not referring to the background color of selected text, or the text on the caret's current row.
Having recently decided to change the editor's colors (tools --> options, fonts & colors tab), I have been unable to figure out the offical name of this doubleclick highlighting to address it's color. I have been through the entire list of choices on the syntax, highlighting, annotation, diff, and versioning sub-tabs without finding an entry with a background color that seemed to match the doubleclick highlighting.
How do I change the background color of this doubleclick highlighted text?
Well the thing your looking for is called occurrences and it can be found in the path:
tools -> options -> fonts&color -> syntax
except it's not in all of the languages, try highlighting the specific language you want this to be a different color in and then you should have the option to change "Mark Occurrences"

double (or triple) curly braces in netbeans (e.g Blade Templates)

This is strange. I have set my background to black and now when I type double braces in netBeans they both becomes black (and thus invisible as the background is also black)
Hers is an example:
<title>{{}}</title>
The title in-between becomes all black. Where in NetBean is responsible for this?
Go to Tools -> Options
Select Font & Color
For Language, select HTML
Select Text from Category
Change the color of the text to a more visible color
Another option is, in the same Options dialog, just change the profile. It will give you predefined settings, so you don't have to mess with each category individually, which sometimes is hard to keep track of and maintain.
EDIT
Change the foreground of Expression Delimiter category. I tested it, and it works and maybe Expression Content, depending on your current settings. You my also need to change Text
Go to Tools -> Options
Select Font & Color
For Language, select HTML
Select "Expression Delimiters" from Category
Set Foreground color to white(if your IDE's background if white). In short, it should be easily visible color when comparing with IDE's
background color.

Eclipse: Make Tabs visible, Spaces invisible

Usually I'd like to edit files with Spaces only.
But when I open files with Tabs, I'd like to see them (for example as arrows ->). With such files I do my edits careful, so not to destroy the original authors coding style -- usually I insert tabs by hand when needed.
So, I want to see Tabs all the time, but using the General, Editors, Text Editors, Show Whitespace Characters option, I get distracted by all the whitespace-dots.
How can I reduce this distraction by Spaces, but at the same time see the Tabs?
Can I change the font color for the visualized whitespaces to a brighter color? currently they are medium gray, but I can not find an option to change that.
Or can I choose different setting for Tabs and for Spaces (and Paragraph signs, for that matter)?
The way I used to have it in my goo' ol' editor would be: Change the background color of Tab to light-yellow (without display the -> for tabs or the dots for Spaces). This makes Tabs wuite visible, without harming my "normal" source visualization. This would be my favorite. I did that by adding the Tab to be a keyword in all languages, and then change the keyword background color to a bright yellow.
According to the Eclipse 3.7M3 New and noteworthy you can customize the Show Whitespace Characters to show only tabs but not spaces.
Unfortunately the stable version of Eclipse 3.7 is expected in 2011 summer but if that feature is a 'must' for you you can try that milestone.