PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
add text at cursor position
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
add text at cursor position
![]() |
add text at cursor position |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
hello
how can a macro write some text at the current cursor position, i.e. when writing an email or editing a task? regards Simon |
|
|
|
#2 |
|
Guest
Posts: n/a
|
You can try using SendKeys. However, if your macro is being fired by a
toolbar button, the cursor will have left the text area. You'd have to try sending TAB keys to get the cursor into the proper position, and then send a specified string to that area. A cleaner approach would be to just write the text to the assumed area using the Outlook Object model - the To or Body properties for example. -- Eric Legault - B.A, MCP, MCSD, Outlook MVP Job: http://www.imaginets.com Blog: http://blogs.officezealot.com/legault "Simon Sunke" <REMOVE_THIS_2_MAIL_Simi@SimiTec.ch> wrote in message news:c108c7$1c1v5h$1@ID-78521.news.uni-berlin.de... > hello > > how can a macro write some text at the current cursor position, i.e. when > writing an email or editing a task? > > regards > Simon > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hi Eric!
"Eric Legault [MVP - Outlook]" <elegaultZZZ@REMOVEZZZmvps.org>wrote: > You can try using SendKeys. However, if your macro is being fired by a > toolbar button, the cursor will have left the text area. You'd have to try > sending TAB keys to get the cursor into the proper position, and then send a > specified string to that area. certainly... but I'd put it on a keyboard-shortcut > A cleaner approach would be to just write the text to the assumed area using > the Outlook Object model - the To or Body properties for example. How can I access that Outlok Object Model? Is there a SDK or tutorial? Thanks Simon |
|
|
|
#4 |
|
Guest
Posts: n/a
|
By keyboard shortcut, do you mean adding the & identifier within the toolbar
button name so that it can be activated by ALT+letter? That might be a problem, because then that button will have focus and you may not be able to get the focus back to the text box that requires the focus. Give it a shot though, it might work. If you are talking about assigning Outlook functions to a particular keyboard stroke(s), like you can in Word - you can't do that in Outlook unfortunately. For best information on the Outlook Object Model, use the Object Browser in the Outlook VBA IDE (Alt+F11, then F2), or reference the VBAOL10.chm file (number depends on version) in your Office installation directory. More info on Outlook VBA: http://www.slipstick.com/dev/vb.htm http://www.outlookcode.com/ -- Eric Legault - B.A, MCP, MCSD, Outlook MVP Job: http://www.imaginets.com Blog: http://blogs.officezealot.com/legault "Simon Sunke" <REMOVE_THIS_2_MAIL_Simi@SimiTec.ch> wrote in message news:c1ghj9$1e8h6m$1@ID-78521.news.uni-berlin.de... > Hi Eric! > > "Eric Legault [MVP - Outlook]" <elegaultZZZ@REMOVEZZZmvps.org>wrote: > > You can try using SendKeys. However, if your macro is being fired by a > > toolbar button, the cursor will have left the text area. You'd have to > try > > sending TAB keys to get the cursor into the proper position, and then send > a > > specified string to that area. > certainly... but I'd put it on a keyboard-shortcut > > > A cleaner approach would be to just write the text to the assumed area > using > > the Outlook Object model - the To or Body properties for example. > How can I access that Outlok Object Model? Is there a SDK or tutorial? > > Thanks > Simon > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

