|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 |
#3
|
||||
|
||||
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 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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
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. |
#5
|
|||
|
|||
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! |
#6
|
||||
|
||||
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] |
#7
|
|||
|
|||
Macropod thank you so much! I used your code to convert the CCs to plain text and it worked perfectly for me!
|
Tags |
content control, save as |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rich text/Plain text Content Controls in Template | michael.fisher5 | Word | 9 | 11-19-2014 06:36 AM |
Turning a manual written Table of content into automatic one. | amronaxon | Word | 3 | 09-20-2014 11:29 AM |
Moving between Rich text content controls | Sammie0Sue | Word | 4 | 03-12-2014 01:43 AM |
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 |