Add XML tags to selected text in memo field located in a subform with command button

harleyskater

IT Manager
Local time
Yesterday, 23:35
Joined
Oct 29, 2007
Messages
95
I haven't seen a lot of information about the xml datatype that now has support with sql 2005. I want to be able to have users make selected text bold ect. from a command button so they don't have to type in the xml tags manually because to them typing <b> memo text </b> is "hard" ;) hahah

I just was hoping for some help with this. was just hoping to take selected/highlighted code copy, and then add the tags and paste :)

What is a good vba function to recognize what text is highlighted/selected?

thank you : ): )
 
I would think you would need to use the clipboard.

Copying and pasting to the clipboard is easy enough using

Code:
docmd.runcommand accmdcopy
docmd.runcommand accmdpaste

You could use this to copy & paste the text to a box on the form and then manipulate the string.

Or you could just manipulate the string directly from the clipboard, if your comfortable API functions. Have a look at http://www.mvps.org/access/api/api0049.htm if you want to do it that way.

If you are certain that all the strings you are going to be placing tags around will be unique in the memo field you could use the replace function to add the string with tags otherwise you will need to use the vba string functions.
 
is this in access?

i have never used them, but at some point access offered advanced formatting in text boxes (rich text or something) i dont know whether this is achieved with xml tags but i thing you would perhaps be better looking at the methods offered in that version

if it is in a version of access that doesnt support rich text format, text boxes, all you will get is spurious characters in the test box - after all xml tags are just text
 

Users who are viewing this thread

Back
Top Bottom