Microsoft Office Forums

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: 8
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: 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

Try something based on:
Code:
ActiveDocument.ContentControls(1).Range.Characters.First.Previous.InsertBefore vbCr
__________________
Cheers,
Paul Edstein
[Fmr 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: 8
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
InsertParagraphBefore Content Control Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM

Other Forums: Access Forums

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