[英]Power Point VBA Extends
如果某個單詞出現在句子中,我想選擇一個句子(整行)。
例如:
句子:您好,我叫vinod。 我來自海得拉巴。
程序:如果在句子中找到“你好”一詞。 打印完整的句子“你好,我叫vinod。我來自海得拉巴。”
我發現了一個在Word VBA中使用擴展的程序。 我想對Power Point使用相同的功能。 這是參考代碼的鏈接
您可以使用TextRange
的Sentences
屬性
Dim sld As Slide, shp As Shape, sentence As TextRange
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame Then
For Each sentence In shp.TextFrame.TextRange.Sentences
If Not sentence.Find("hello", , , msoTrue) Is Nothing Then
Debug.Print sentence ' <-- do the action you want on the sentence
End If
Next
End If
Next
Next
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.