Microsoft Office Forums InsertParagraphBefore Content Control

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2019, 06:15 AM
Bertus Bertus is offline InsertParagraphBefore Content Control Windows 10 InsertParagraphBefore Content Control Office 2016
Novice
InsertParagraphBefore Content Control
 
Join Date: Mar 2019
Posts: 2
Bertus is on a distinguished road
Default InsertParagraphBefore Content Control


Hi, I'm trying to do:

Code:
If Len(strValue) > 1 Then
  cc.Range.Text = strValue
  cc.Range.InsertParagraphBefore
EndIf
where cc is a RichText Content control.

VBA throws a runtime error 4605 (Command not available) on the InsertParagraphBefore command

Any ideas how to get this working?

Thanks!
Bart
Reply With Quote
  #2  
Old 03-01-2019, 01:45 PM
macropod's Avatar
macropod macropod is offline InsertParagraphBefore Content Control Windows 7 64bit InsertParagraphBefore Content Control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,533
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Try something based on:
Code:
ActiveDocument.ContentControls(1).Range.Characters.First.Previous.InsertBefore vbCr
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 03-02-2019, 02:36 AM
Bertus Bertus is offline InsertParagraphBefore Content Control Windows 10 InsertParagraphBefore Content Control Office 2016
Novice
InsertParagraphBefore Content Control
 
Join Date: Mar 2019
Posts: 2
Bertus is on a distinguished road
Default

Excellent Paul, thank you very much!
Bart
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Control content deleted when re-uploading to SharePoint Peterson Word 5 06-27-2018 08:13 PM
InsertParagraphBefore Content Control One Content Control Checkbox checks another Content Control Checkbox DEsh Word VBA 2 10-06-2017 08:23 PM
InsertParagraphBefore Content Control Help with Content Control Box dep7418 Word 2 12-18-2016 08:08 PM
InsertParagraphBefore Content Control Clicking the selected Content Control checkbox returns wrong control in vba event DougsGraphics Word VBA 2 06-24-2015 07:31 AM
Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM


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


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