Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2016, 12:56 PM
JuliaZ JuliaZ is offline Copy Text only of a Content Control Windows 7 32bit Copy Text only of a Content Control Office 2013
Novice
Copy Text only of a Content Control
 
Join Date: Jul 2016
Posts: 3
JuliaZ is on a distinguished road
Default Copy Text only of a Content Control

Is there a way to select a content control in Word 2013 and copy the text only? When the content control is selected and copied and then pasted into another document, Word copies the content control into the document along with the text. We only want the text to be copied, not the content control itself.
Reply With Quote
  #2  
Old 07-27-2016, 11:22 PM
gmayor's Avatar
gmayor gmayor is offline Copy Text only of a Content Control Windows 10 Copy Text only of a Content Control Office 2016
Expert
 
Join Date: Aug 2014
Posts: 3,382
gmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to all
Default

If you are copying and pasting manually then, it is not the copying that is the problem but the pasting. Select Paste > Keep Text Only.
__________________
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
  #3  
Old 07-28-2016, 07:03 AM
JuliaZ JuliaZ is offline Copy Text only of a Content Control Windows 7 32bit Copy Text only of a Content Control Office 2013
Novice
Copy Text only of a Content Control
 
Join Date: Jul 2016
Posts: 3
JuliaZ is on a distinguished road
Default

I tried doing Keep Text only and then I lose underscores, strikethroughs, etc. I want to keep all formatting and text, just not the Content Control itself.
Reply With Quote
  #4  
Old 07-28-2016, 08:59 PM
gmayor's Avatar
gmayor gmayor is offline Copy Text only of a Content Control Windows 10 Copy Text only of a Content Control Office 2016
Expert
 
Join Date: Aug 2014
Posts: 3,382
gmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to all
Default

In that case you will need a macro. The following should do the job, copying the formatted text of the content control containing the cursor to the clipboard.

Code:
Sub CopyCC_Content()
Dim oCC As ContentControl
Dim oRng As Range
    On Error GoTo lbl_Exit
    For Each oCC In ActiveDocument.ContentControls
        If Selection.InRange(oCC.Range) Then
            Set oRng = oCC.Range
            oCC.Delete
            oRng.FormattedText.Copy
            ActiveDocument.Undo 1
            Exit For
        End If
    Next oCC
lbl_Exit:
    Exit Sub
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
  #5  
Old 07-29-2016, 01:15 PM
JuliaZ JuliaZ is offline Copy Text only of a Content Control Windows 7 32bit Copy Text only of a Content Control Office 2013
Novice
Copy Text only of a Content Control
 
Join Date: Jul 2016
Posts: 3
JuliaZ is on a distinguished road
Default

Is there any way to get the contents without deleting the original content control? If something happens (the user clicks undo, or word ends abruptly), we don't want the original document to lose its content control.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Text only of a Content Control Content Control Copy - Copies Data and CC itself shammi_raj Word 3 03-30-2016 07:01 PM
Is there VBA to paste text into content control? kintap Word VBA 2 07-02-2014 07:42 AM
Copy content control entries to next table next page Mel_Herndon Word VBA 2 05-22-2014 05:07 PM
Copy Text only of a Content Control Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 07:37 PM.


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