Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 04-02-2015, 02:57 AM
gmayor's Avatar
gmayor gmayor is offline possible to always PASTE with same style? Windows 7 64bit possible to always PASTE with same style? Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

If you save the following macro in the document template (which will thus have to be saved as macro enabled). It will intercept the Paste command in documents created from the template (provided the person opening the document so created still has access to the template). The result will be to match the pasted text to the font at the position the text is inserted. In the case of a rich text content control, the font will be that of the style associated with the control.

See http://www.gmayor.com/installing_macro.htm

Code:
Option Explicit
Sub EditPaste()
    PasteUnfText
lbl_Exit:
    Exit Sub
End Sub

Private Sub PasteUnfText()
    On Error GoTo err_Handler
    Selection.PasteSpecial DataType:=wdPasteText, _
                           Placement:=wdInLine
lbl_Exit:
    Exit Sub
err_Handler:
    Beep
    GoTo lbl_Exit
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 

Tags
content controls, paste, paste options

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
possible to always PASTE with same style? Use multiple style sets in the same Word document (depending on which section the style is in) Ricyteach Word VBA 6 03-09-2015 07:11 PM
possible to always PASTE with same style? How to globally change the formatting of a bullet style to another style? ravl13 Word 5 03-10-2013 05:04 PM
Config style to restart numbering if it it comes after a style of a higher level ghumdinger Word 7 08-31-2011 01:10 AM
How to create macro to paste text after style? Srivas Word 0 03-16-2010 05:28 AM
Character style stripped while applying paragraph style sams_gates Word 0 08-29-2009 02:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft