Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-11-2013, 11:38 PM
macropod's Avatar
macropod macropod is offline Deleting a table from a content control -- preserving the content control Windows 7 32bit Deleting a table from a content control -- preserving the content control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

In the document I posted, there is a paragraph mark after the table because a document must always have at least one ordinary paragraph following the last table in the document. The same applies to tables within a content control; so how did you get your table into a content control without the terminating paragraph mark?

In any event, there are ways around this. For example:


Code:
Sub DelCCTbl()
Dim Rng As Range
With ActiveDocument.ContentControls(1).Range
  Set Rng = .Tables(1).Range
  .Tables(1).ConvertToText
  With Rng
    .End = .End - 1
    .Start = .Start + 1
    .Delete
  End With
  Set Rng = Nothing
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 10-11-2013 at 11:46 PM. Reason: Updated code
Reply With Quote
Reply

Tags
content controls, deleting, tables



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a table from a content control -- preserving the content control Hierarchical content control ntjson Word VBA 1 04-04-2013 12:07 AM
Deleting a table from a content control -- preserving the content control Clearing content control tick box within table jillapass Word VBA 1 08-08-2012 04:58 PM
Word2010 check boxes and plain text content control boxes in same table fcsungard Word 5 06-01-2012 01:16 AM
Deleting a table from a content control -- preserving the content control Content control titles jillapass Word VBA 3 05-29-2012 06:11 AM
Retrieving content control value jillapass Word VBA 4 05-24-2012 05:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:32 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