Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2014, 12:33 PM
jpb103's Avatar
jpb103 jpb103 is offline Retrieving Rich Text from a RTF Text box in a User Form Windows 7 64bit Retrieving Rich Text from a RTF Text box in a User Form Office 2007
Advanced Beginner
Retrieving Rich Text from a RTF Text box in a User Form
 
Join Date: May 2014
Location: Thunder Bay, Ontario
Posts: 58
jpb103 is on a distinguished road
Default


Code:
Dim oRng as Range
Set oRng = DescriptionBox.TextRTF
oRow.Cells(1).Range.FormattedText = oRng
Code:
oRow.Cells(1).Range.FormattedText = DescriptionBox.TextRTF
These two code segments perform exactly the same operation. Setting oRng is redundant to the logic.
Reply With Quote
  #2  
Old 06-19-2014, 12:41 PM
Cosmo Cosmo is offline Retrieving Rich Text from a RTF Text box in a User Form Windows Vista Retrieving Rich Text from a RTF Text box in a User Form Office 2007
Competent Performer
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Quote:
Originally Posted by jpb103 View Post
Code:
Dim oRng as Range
Set oRng = DescriptionBox.TextRTF
oRow.Cells(1).Range.FormattedText = oRng
Code:
oRow.Cells(1).Range.FormattedText = DescriptionBox.TextRTF
These two code segments perform exactly the same operation. Setting oRng is redundant to the logic.
DescriptionBox.TextRTF is a String
oRng is a Range

The first cannot work, as you cannot set a range variable to a string.

The second might work, assuming that the .Range.FormattedText accepts a string of formatted text (which is what you see).
Reply With Quote
Reply

Tags
rich text, tables, userforms

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving Rich Text from a RTF Text box in a User Form Rich text/Plain text Content Controls in Template michael.fisher5 Word 9 11-19-2014 06:36 AM
Retrieving Rich Text from a RTF Text box in a User Form Rich Text Content Control - Allow User Formatting keithacochrane Word 1 05-28-2012 05:06 PM
Retrieving Rich Text from a RTF Text box in a User Form How to I make text Bold in a User Form -Visual Basic gurp99 Word VBA 11 03-12-2012 04:05 PM
My plain text post got converted to rich text in a reply, how to convert it back? david.karr Outlook 0 01-05-2012 09:46 AM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:14 AM.


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