TinyMCE- Formatting in paste - formatting

When we copy some content from any source and paste the content into the RTE :
I want to retain the default font style and font size of RTE.
The other styles can be pasted as-is from the source.
I have checked [paste_auto_cleanup_on_paste] property clears all the formatting like <h1> <b> etc.
Is there any other property?
Please suggest!

From the Docs:
paste_retain_style_properties
This options allows you to specify which styles you want to retain
when pasting contents from MS Word and similar Office suite products.
This option can be set to a space separated list of CSS style names,
or "all" if you want all styles to be retained.
Add this paramter to your tinymce config anf it should keep those things:
paste_retain_style_properties: "font-size font-style"

Related

Set font style for entire word document - VBA

I'm trying to figure out how to set the font style for an entire word document, exactly the way it's done by choosing a style preset in the menu:
Since I've already made a macro that converts the entire document word for word, what I'm trying to accomplish with this is changing all the preset tiles (Normal, No Spacing, Title, Heading 1, etc.) to match this existing preset, and not the old presets (with the old fonts).
Is this possible, and what object do I modify to accomplish this?
Try this ...
Sub ChgFontInAllStyles()
Dim sty As Word.Style
For Each sty In ActiveDocument.Styles
If sty.InUse And sty.Type = wdStyleTypeParagraph Then
sty.Font.Name = "Arial"
End If
Next
End Sub
What you show in the screen shot is an Office Theme. This is not the same as a Word style, although some of the settings do "filter through" to the built-in styles and custom styles that base on these.
Themes is a complex topic if it's a question of defining a custom theme programmatically. If all you want to do is apply an existing theme, then:
Dim sThemePath as String
sThemePath = "C:\Program Files\Microsoft Office\Document Themes 14\Equity.thmx"
ActiveDocument.ApplyDocumentTheme sThemePath
It's necessary to specify the entire path. In the sample code this is the default path for the built-in Office themes for Office 2010.

Replace a blank before a table page break Word VBA

I uncheck "Allow row to break across pages" for a table's properties So, the table is shown on a new page to ensure that all the content is on one page, this works fine. But Word generates a blank space before the page break, I need to replace it with some text for a legal reason. I can't use a watermark or shapes because un Oracle BI Publisher only prints it on PDF and I need to export it to a docx.
The data is dynamic, so sometimes the text before the table and the text inside the table may change.
Current Version https://imgur.com/a/FTx0q
I need some like this https://imgur.com/a/ySitL
MS Office support told me that it can't be done with Word...
Maybe with VBA code?
Update
Thanks Cindy for your help.
I have a table into another table many paragraphs, checkbox etc and they are fitting on a new page. It's working.
I understand there isn't a page break.
It's Paragraph mark.
But what I need to do is insert a kind of mark, a text like XXXX,-----------, Instead of leaving "free space",
It's a requirement not change the font size or another text format.
For a legal requirement, some paragraph must fit on a new page and "blank spaces" replaced by a kind of mark.
I can't hard code it because in several cases not all the paragraphs or section in a page will be shown and I don't know by default when a new page is needed.
I am available to use macros or anything.
What you could do is insert a page-size table into a textbox in the page header and format the body text with a white background. The table will thus be hidden behind any text on the page, but not otherwise (provided you don't pad unused space with empty paragraphs, etc.).

Microsoft Word MacroButton - placeholder text visibility

I have a Microsoft Office 2013 Word template, in which I have some text-field elements, created by using Quick Parts -> Field -> MACROBUTTON noname [Type your text here].
If I fill only some of these fields (i.e. "[Name]", "[Address]") and I print or save as PDF, all the fields that I have not filled will display as [Insert your text here] in the printed paper or PDF. To be clear, the placeholder text must be manually removed (or replaced with the text you want).
I've readed somewhere, that you can create a macro, which will not display the placeholder text in the PFD- or printed version of the document, if there is no text written manually to that specific field (you leave it as it was). As this would be handy in cases, where you don't fill all the neccessery fields, my question is:
Q: Can this be achieved only by using Macro Button, and if not, what is needed to create text fields as described below that are not included in the printed or PDF saved version of the document?
This cannot be achieved without using actual macro code. Right now your solution contains no macro code, the fields simply function as "targets" and when the user types on the field it is deleted. Where the user does not type, the prompt remains. You'd need code to delete these fields from the document.
Given your requirement, the code would have to fire in the DocumentBeforeSave and the DocumentBeforePrint events. These events require a class and supporting code in a standard module. The basic information on how to set these up is in the Word object model language reference: https://msdn.microsoft.com/en-us/library/office/ff821218.aspx
An alternative to MacroButton fields would be to use ContentControls. But here, again, code and the same events would be required to remove/hide placeholder text.

How to assign paragraph / character styles automatically in word 2010

Hi I've a 200 pg fully formatted word document. The person who had worked on it earlier had not applied any style to the whole document and he has done it manually. Though the formatting was done very neatly it has become my job to assign character/paragraph styles to each and every paragraph. Does any one know of a script which assigns character/paragraph styles automatically to the existing word 2010 document?
You'd better use Word VBA to deal with your issue.
What you should do is:
Find the style you want to replace with a style (see MSDN or some tips)
Apply style to the found selection (see this SO thread: How do I apply a style to multiple selections in Word using VBA?)
If you want to check the right style, you can record a macro and adapt it.
You can use the Find and Replace dialog to find text based on its format (e.g. Bold, Size 14) and replace it with a Style (e.g. Heading 2).
This article sums it up pretty well....
http://www.howtogeek.com/howto/microsoft-office/search-and-replace-specific-formatting-fonts-stylesetc-in-microsoft-word/

Copy Special Symbols From One PowerPoint Presentation to Another

I need to copy text from one PowerPoint presentation to another. However, I have problems copying special symbols, such as smileys, which appear in the target presentation as empty boxes. Looking at the Open XML file in the original presentation, I can see that the Run containing the smiley has a "SymbolFont" attribute:
<a:sym typeface="Wingdings" />
However, in VBA, Shape.TextFrame2.TextRange2.Font =the Font of that Run - shows Arial.
How can I determine the SymbolFont of a text Run using VBA or C# (not XML)?
Then I could specify that SymbolFont in the target presentation.
Perhaps there other ways for copying the text that do not involve XML?
Note that this problem happens not only with Smileys; other special characters may show different SymbolFonts, such as:
<a:symTypeface = "Symbol", PitchFamily = 18, CharacterSet = 2>
Code example:
getRuns(TextRange2 paragraph)
{
foreach(TextRange2 run in paragraph.get_Runs(-1,-1))
_myRuns.Add(new MyRun {_text=run.Text, _font=run.Font} );
}
copyRunsToParagraph(TextRange2 paragraph)
{
foreach(MyRun run in _myRuns)
paragraph=paragraph.InsertAfter(run._text);
}
Note: Run.Font seems to return only the Latin font, not the Symbol font, e.g., Arial but not Wingdings. As I wrote, different symbols may have different SymbolFonts, so always using Wingdings does not work.
This can't be done in VBA.