Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2016, 12:57 PM
vitesse vitesse is offline Save as .docx without content controls (just the text that was written in them) Windows 10 Save as .docx without content controls (just the text that was written in them) Office 2013
Novice
Save as .docx without content controls (just the text that was written in them)
 
Join Date: Sep 2016
Posts: 2
vitesse is on a distinguished road
Default Save as .docx without content controls (just the text that was written in them)

What I want to do is create a file with content controls to fill in repeat text and when I'm done, convert all content controls to static text and save it as another file.
The reason why I need this is that I use master files, change the names and info and send them to other people. They're not very tech savvy so the target file has to be just plain word without anything fancy.

I know this is possible by saving as .doc, but that also changes the formatting to pre-2007 which can cause other problems and I don't want to just save it as a PDF because I need the file to still be editable.



Thanks in advance.

Last edited by vitesse; 09-15-2016 at 01:02 PM. Reason: clarification
Reply With Quote
  #2  
Old 09-15-2016, 04:15 PM
Charles Kenyon Charles Kenyon is offline Save as .docx without content controls (just the text that was written in them) Windows 8 Save as .docx without content controls (just the text that was written in them) Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

You can use Greg Maxey's Content Control tools to change them to text.
Otherwise, you would need macros that are beyond my skill level.
http://gregmaxey.com/word_tip_pages/...rol_tools.html
Reply With Quote
  #3  
Old 09-15-2016, 05:42 PM
macropod's Avatar
macropod macropod is offline Save as .docx without content controls (just the text that was written in them) Windows 7 64bit Save as .docx without content controls (just the text that was written in them) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Unless you do it manually, one content control at a time, you'll need a macro to delete the content controls. For example:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument
  For i = .ContentControls.Count To 1 Step -1
    With .ContentControls(i)
      .LockContentControl = False
      .Delete False
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
or:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument
  Do While .ContentControls.Count > 0
    With .ContentControls(1)
      .LockContentControl = False
      .Delete False
    End With
  Loop
End With
Application.ScreenUpdating = True
End Sub
Do note that macros can't be stored in docx files, so you'd need to add it to the relevant document's template.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 09-16-2016, 12:21 AM
vitesse vitesse is offline Save as .docx without content controls (just the text that was written in them) Windows 10 Save as .docx without content controls (just the text that was written in them) Office 2013
Novice
Save as .docx without content controls (just the text that was written in them)
 
Join Date: Sep 2016
Posts: 2
vitesse is on a distinguished road
Default

Thank you both for your prompt answers.

A really dumb way to do what I need would be to save as .doc and save as .docx again and hope everything that gets messed up in .doc is fixed when saved as .docx, but I'm glad there are better options.

Charles, while searching for a solution, I stumbled upon that yesterday. At first glance it seems a bit daunting in its complexity, but I'm sure that after spending a little time tinkering with it I'll figure out how to use it. I'll keep it in mind moving forward.

At the moment though, what I hoped for was a simple solution, which VBA sort of is in this instance. Having worked with VBA in Excel, I can manage with this.

I'll work on integrating this into my workflow and go from there.

Thanks again.

P.S. I really hope the range of IPs that are being used by my ISP get unbanned and I don't have to go through a VPN every time I want to use this forum. I was surprised to see that when I first tried making an account it told me my IP was banned. Trying again with a different IP (dynamic IP) got the same answer. I get why it happened - people who had these IPs did something, I still wish it didn't complicate things for me. Anyway, have a nice day.
Reply With Quote
  #5  
Old 08-12-2022, 12:55 AM
shanshan89 shanshan89 is offline Save as .docx without content controls (just the text that was written in them) Windows 10 Save as .docx without content controls (just the text that was written in them) Office 2019
Novice
 
Join Date: Jul 2022
Posts: 17
shanshan89 is on a distinguished road
Smile

I would like to ask if there is any solution for this yet? To convert a .dotm macro directly to .docx, changing all text within content controls to plain text. The only solution that works for me is to first save it as a word file (in doc format), then save it again as a docx word file, but it seems quite manual.

The reason why I'm asking is because I'm trying to read a docx file into Python with python-docx. However, python-docx cannot detect any text in content controls.

Thanks!
Reply With Quote
  #6  
Old 08-12-2022, 01:23 AM
macropod's Avatar
macropod macropod is offline Save as .docx without content controls (just the text that was written in them) Windows 10 Save as .docx without content controls (just the text that was written in them) Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

As per post #2, the content controls can be deleted via code. It shouldn't matter whether python-docx can detect any text in content controls, since (as per the VBA examples I posted) the content controls are explicitly being deleted.

PS: Please stop quoting entire previous posts in your replies. Doing so only adds clutter. If there is something in a previous post that needs quoting, quote only that part.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 08-12-2022, 02:01 AM
shanshan89 shanshan89 is offline Save as .docx without content controls (just the text that was written in them) Windows 10 Save as .docx without content controls (just the text that was written in them) Office 2019
Novice
 
Join Date: Jul 2022
Posts: 17
shanshan89 is on a distinguished road
Thumbs up

Macropod thank you so much! I used your code to convert the CCs to plain text and it worked perfectly for me!
Reply With Quote
Reply

Tags
content control, save as



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save as .docx without content controls (just the text that was written in them) Rich text/Plain text Content Controls in Template michael.fisher5 Word 9 11-19-2014 06:36 AM
Save as .docx without content controls (just the text that was written in them) Turning a manual written Table of content into automatic one. amronaxon Word 3 09-20-2014 11:29 AM
Save as .docx without content controls (just the text that was written in them) Moving between Rich text content controls Sammie0Sue Word 4 03-12-2014 01:43 AM
Save as .docx without content controls (just the text that was written in them) Rich Text Content Controls: Formatting? tinfanide Word VBA 8 03-04-2013 04:15 AM
Animation: text appears as if written by pen ionas.iona PowerPoint 0 03-31-2011 05:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:03 AM.


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