, , , Select, , / .
, , Selection, Range, :
Dim myRange as Range
Set myRange = Application.InputBox("Select your range", Type:=8)
, , , , Selection ( Pandora Box , ...).
, PowerPoint. RibbonUI XML VBA, Shapes PowerPoint . , "" - , .. t , GUID.
Selection, , - ,
Sub UpdateOrEditSelection(update As Boolean)
'This procedure invoked when user edits/updates a chart.
Dim uid As Variant
Dim sel As Selection
Dim s As Integer
Dim chartsToUpdate As Object
Dim multipleShapes As Boolean
Dim sld As Slide
Set sel = ppPres.Windows(1).Selection
If update Then
Set chartsToUpdate = CreateObject("Scripting.Dictionary")
Select Case sel.Type
Case ppSelectionShapes
For s = 1 To sel.ShapeRange.count
uid = sel.ShapeRange(s).Name
'....
'...
'..
'.
Next
Case ppSelectionSlides
For Each sld In sel.SlideRange
For s = 1 To sld.Shapes.count
uid = sld.Shapes(s).Name
'....
'...
'..
'.
Next
Next
Case ppSelectionText
s = 1
If sel.ShapeRange(s).HasTable Or sel.ShapeRange(s).HasChart Then
uid = sel.ShapeRange(s).Name
'....
'...
'..
'.
End If
End Select
'....
'...
'..
'.
?
. , : , , , , .. . , , , , , , :
Excel VBA
, ?
. VBA mouseclicks, .
:
, Select. , IMO Excel, .
( VBA - Excel):
- - , Selection.
- PowerPoint - , , / - . "" -, .
:
Set tb = cht.Shapes.AddTextbox(msoTextOrientationHorizontal, ptLeft, tBoxTop, ptWidth, ptHeight)
tb.Select '<--- KEEP THIS LINE OTHERWISE TEXTBOX ALIGNMENT WILL NOT WORK
:
'PPT requires selecting the slide in order to export an image preview/jpg
sld.Select
ppPres.Windows(1).View.GotoSlide sld.SlideIndex
sld.Shapes(1).Chart.Export imgPath, ppShapeFormatJPG
, Point:
pt.Select
pt.format.Line.Visible = msoTrue
pt.format.Line.Visible = msoFalse
pt.MarkerSize = pt.MarkerSize + 2
, , . PowerPoint, PowerPoint , Excel, , Excel Word .
- Outlook: I don't really like Outlook, it is very similar to Word and actually uses the Word object model in the inspector, but what I do with Outlook relies on things like ActiveInspector etc.
Neither Word nor PowerPoint has a "macro recorder" anymore (in fact, I think Word can, but it is so powerless that it is useless), and by the time most people do any development in other applications, they figured out most of it already.