Hai
i am new to dis programing word anybady help me out?

in my appliction i want to implement autotext functionality like in ms word.

im not getting how to implement it....
plz help me
thanx in advance.

Recommended Answers

All 3 Replies

Can you be more specific about the problem...

As I recall it, autotext in word is merely a collection of predefined strings which can be added to a document using for example the menu or a short key.

Is this what you want too? And do you want to do this is a (rich)textbox-control or something? What is the precise difficulty?

Please add some extra info...

Can you be more specific about the problem...

As I recall it, autotext in word is merely a collection of predefined strings which can be added to a document using for example the menu or a short key.

Is this what you want too? And do you want to do this is a (rich)textbox-control or something? What is the precise difficulty?

Please add some extra info...

ya exactly if user insert one shortcut for ex: if he repetedly typing 'My name is' in the document and he wants to have shortcut like 'Mni, whenever he types 'Mne' it should convert to 'My name is'. and im usisg Tx Textcontrol in my apllication.....

You could use a dictionary collection to store the shortcodes (e.g. HybridDictionary)
See:
http://msdn2.microsoft.com/en-us/library/system.collections.specialized.hybriddictionary.aspx

Store the codes and results:

Dim autotext As New HybridDictionary()
 autotext.Add("mni", "My nme is")
' etc...

Then you can catch onkeyup or onchar event of the text control and check the last word (use position of caret and position of last space before the carets position) against the keys in the collection.

N.B.
If you like, you can make sure the check only is done when a 'space' is entered by checking the entered character in the onchar or onkeyup event.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.