locked
Accesss multiple textrange-selections (VB.NET) RRS feed

  • Question

  • In my PowerPoint 2013 I am able to select different ranges of characters in one or even in many shapes. e.g.

    First shape has the text: "We will find the solution!"

    Second shape has the text: "And we will be fast."

    The selected characters on the screen could be: "We find And we fast."

    Now what do I have to do in my vb.net code to make all four textranges bold.

    My code is as follows:

    Dim oSelection As Selection = oActiveWindow.Selection
    Dim oTextRange As TextRange = oSelection.TextRange
    If oTextRange.Count > 0 Then
    	oTextRange.Font.Bold = MsoTriState.msoTrue
    End If

    But this code only changes the characters of the last selected textrange to bold. e.g. in this case only "fast." would be bold.

    I have tried to experiement with Microsoft.Office.Core.textrange2 but here I get the error:

    (Exception of HRESULT: 0x80004002 (E_NOINTERFACE))

    Any help is very appreciated. Many thanks.

    Friday, November 20, 2015 11:25 AM

Answers

  • Hi Jack,

    many thanks for the answer. You are absolutely right. I was not aware of the fact that I am possibly in the wrong forum.

    I have moved my question to Visual Studio Development, Microsoft Office for Developers > Visual Studio Tools for Office (VSTO):

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/292af0c9-5089-4594-83a1-9823591a0f03/accesss-multiple-textrangeselections-vbnet?forum=vsto

    And I will mark this one as answered. SORRY for the mess.

    Best Regards,

    Sven


    • Marked as answer by MoD66 Tuesday, November 24, 2015 7:40 AM
    • Edited by MoD66 Tuesday, November 24, 2015 7:41 AM Link did not work
    Tuesday, November 24, 2015 7:40 AM

All replies

  • Hi MoD66,

    Actually this forum is to discuss the test project, it seems that it is not related to the unit test project, am I right?

    >>

    In my PowerPoint 2013 I am able to select different ranges of characters in one or even in many shapes. e.g.

    First shape has the text: "We will find the solution!"

    Second shape has the text: "And we will be fast."

    >>

    Could you share us a screen shot about the above result or the real issue in your side?

    It seems that it is related to the VB code, am I right? If so, which kind of VB app did you really create?

    Maybe you could share us more detailed information about this issue, so we could really provide you a more appropriate forum.

    Best Regards,

    Jack


    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, November 23, 2015 10:00 AM
  • Hi Jack,

    many thanks for the answer. You are absolutely right. I was not aware of the fact that I am possibly in the wrong forum.

    I have moved my question to Visual Studio Development, Microsoft Office for Developers > Visual Studio Tools for Office (VSTO):

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/292af0c9-5089-4594-83a1-9823591a0f03/accesss-multiple-textrangeselections-vbnet?forum=vsto

    And I will mark this one as answered. SORRY for the mess.

    Best Regards,

    Sven


    • Marked as answer by MoD66 Tuesday, November 24, 2015 7:40 AM
    • Edited by MoD66 Tuesday, November 24, 2015 7:41 AM Link did not work
    Tuesday, November 24, 2015 7:40 AM