Solved

getting position of paragraph range in powerpoint 2010 vba

Posted on 2014-01-07
1
773 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

696 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