A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
I want ONLY to apply the bold to the selected text.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to format a selected text in a Textbox, so I came up with the folowing code:
Application.ActiveWindow.Selection.ShapeRange(TextBox2.Text).TextFrame.TextRange.Font.Bold = msoTrue
The problem is that it says that there is no currently active window. I know more or less why, but I don't know how I can fix this problem. Will be very happy if someone could help me!
A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
I want ONLY to apply the bold to the selected text.
I think you've already posted in stack trace where I replied. You can select text in slide show only if it is a activex control. If you are using a text control then you can bold all of the text and not a selection. To be able to bold only specific blocks of text make use of the RichTextBox control.
Are you trying to format selected text in an ActivX textbox in slide show mode? (This is the only way I can see there being no ActiveWindow)
I don't think you will be able to do this.
If that's what you are trying to do this will bold all the text but not just selected text in an ActivX textbox named TextBox2
Sub BoldMe()
Dim osld As Slide
Set osld = SlideShowWindows(1).View.Slide
osld.Shapes("TextBox2").OLEFormat.Object.Font.Bold = True
End Sub
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more