Solved

getting position of paragraph range in powerpoint 2010 vba

Posted on 2014-01-07
1
742 Views
Last Modified: 2014-01-07
Have the follwoing code:

pptSlide.Shapes.Range(2).TextFrame.TextRange.Paragraphs(3).text = vbNewLine & "Priority:     1     2     3"

Based on a query I need to draw a red box around either the 1, 2, or 3 on the slide.  How can i get the x and y of the paragraph(3) to do so?  Unless there is an alternative method that is easier :)
0
Comment
Question by:HyperBPP
1 Comment
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 total points
ID: 39762563
Dim otxR As TextRange
Dim myBox As Shape
Set otxR = pptSlide.Shapes.Range(2).TextFrame.TextRange.Paragraphs(3)
Set myBox = pptSlide.Shapes.AddShape(msoShapeRectangle, Left:=otxR.BoundLeft, _
Top:=otxR.BoundTop, _
Width:=otxR.BoundWidth, _
Height:=otxR.BoundHeight)
myBox.Fill.Visible = False
myBox.Line.ForeColor.RGB = vbRed

NOTE because you added a NewLine the box may draw around the blank newline! You may need to change the paragraph number to 4
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now