none
Vertical character offset RRS feed

  • Question

  • In a winforms richtextcontrol I can program character height using "selectioncharoffset".  How can I achieve the same effect in a VSTO project using Word2007.  Word recognises the rtf codes correctly but how can I reproduce this in code. Is a winforms richtextcontrol the only way to do this??

    martin_taunton

    Friday, October 3, 2014 7:14 PM

All replies

  • Hello Martin,

    Could you please be more specific? Are you talking about the Ribbon controls or the document itself?

    I'd suggest asking Word specific questions on the Word for Developers forum instead.

    Friday, October 3, 2014 7:31 PM
  • Thanks for your reply Eugene.  I refer to the document itself.  I want to be able to insert characters at various heights (without changing fontsize) and I know this can be done in a winforms richtextcontrol using the SelectionCharOffset property.  Each individual character can be set to appear at the height I choose for it.  I was hoping to achieve the same effect with a Word project but it looks as if the winforms RichTextControl is my only option. Am I  correct??  I have asked about this on the WORD FOR DEVELOPERS forum.  Thanks.

    martin_taunton

    Friday, October 3, 2014 8:48 PM
  • VSTO doesn't provide anything for this. The  Word for Developers forum is the right place for such questions.

    The Rich Text Editor controls is not related to Word.

    Saturday, October 4, 2014 11:03 AM
  • Hi Martin,

    Richtextcontrol in Word is different from it in Winform.

    In Word, richtextcontrol is a content control. Go through ContentControl Properties, there is no way to set character height. Also, we can't set the height manually.

    What I found is that we can set font size to change the height of a content control.

    If you need this feature, please feel free to submit feedback by clicking the smile.

    Regards,

    George.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 6, 2014 9:42 AM
    Moderator
  • Thank you George for your reply.  I have been working on a midi music program in Visual Studio for a number of years now and have had good success with WPF. The screenshot below shows the results of keying in (from a midi keyboard) the first few notes of White Christmas, and as you will notice, the relative pitches can be seen in the lower part of the screenshot which is a hosted windows forms richtextcontrol.  In fact the vertical offsets are coded with the exact midi note number so that the music can be played back. The point is that the rhythm can be entered after the melody making it easier for those who cannot record live into a sequencer to record a song.

    My concern is that sometime this kind of support for Windows Forms Host with a RichTextBox might be withdrawn so I have been looking to port my program to WPF without using Winforms Host  or WORD FOR DEVELOPERS. 

    Although I cannot see an easy answer to this from your earlier reply, perhaps you could offer me some reassurance that I will always be able to develop my program using WPF with a WindowsFormsHost.

    I would be very pleased to read your views on this. 

    Thank you

    Martin Taunton  (UK)


    martin_taunton

    Monday, October 6, 2014 12:12 PM