Setting Rich Text Formatting Programmatically

Published 02 July 07 02:00 PM

Someone asked about setting the formatting for rich text programmatically, and if there was an object model for the text formatting.  There isn't, but the text is simply HTML, so it isn't hard to do through code.  Here's a trick to see how our text is formatted and to update the HTML manually: 

  1. Copy/Paste the text box that has Rich Text
  2. Select the text box
  3. Change the Text Format property on the Data tab to Plain Text
  4. Select a different property to commit the property change and click OK to the warning
  5. Browse the form and edit the data in the Rich Text box
Now you can see the HTML we generate and modify it directly.
Filed under: ,

Comments

# Gina said on July 2, 2007 8:48 PM:

Please keep me informed, this is a useul tool.

# Stevbe said on July 3, 2007 6:19 AM:

Is there a schema we can use to validate the html?

# Khuzema said on July 3, 2007 11:50 AM:

Its little bit off topic, but can you kindly point to any guide or info on ms access 2007 front end and Sql Server 2005 as a Back end with odbc link. searched net found nothing.

thanks

Khuzema

# Erik Rucker said on July 3, 2007 2:07 PM:

The HTML schema is the same as for SharePoint, and I believe it is published so you can validate against it, but I didn't find it in a quick search.  Another alternative is to use SharePoint Designer, which has SharePoint as a target and will work.  

Building a front-end to SQL is pretty simple, but the way you do it depends on if you're publishing a database to SQL when creating the front-end or if you're linking to existing tables.  If you're linking, then you just build the links like any odbc links, and there's decent help for this in the online help.  If you're publishing, simply choose the "SQL Server" icon under Database Tools, and follow the dialogs.

# Zac Woodall said on July 3, 2007 9:00 PM:

If you're going to be doing Access against SQL work, one really great resource is the book by Andy Baron and Mary Chipman here: http://www.amazon.com/Microsoft-Access-Developers-Guide-Server/dp/product-description/0672319446

These two are old Access pros and they probably know more about building high-performance Access front-ends against SQL Server than just about anyone.  Note that this book targets Access 2000, but it should still be pretty current.  

Thanks!

-Zac.

# Khuzema said on July 4, 2007 11:52 AM:

thanks Zac, but the book is for 2000, and we are using Access 2007 and Sql Server 2005. If there is any whitepaper from MS about how go about it.

thanks

Khuzema

# ngins said on July 6, 2007 12:57 AM:

Zac -- I have that book, and it's a great book. But, unfortunately, it focuses primarily on ADPs against SQL Server. I believe there's just one chapter on using MDBs. But it's great for learning about SQL Server.

# ngins said on July 6, 2007 1:12 AM:

Erik: Thanks for posting. Any chance of getting an object model for the text formatting in the future? While applying HTML tags should be simple enough, editing the formatting of text with tags already applied can be a bit thorny, especially if the formatting is complex.

Also, are there any plans for additional formats, such as full text justification, in a future release?

Thanks!

Neil

New Comments to this post are disabled
Page view tracker