2017-01-28 7 views
0

私は、文章中に特定の単語がある場合は、文章(完全な行)を選択したいと思います。パワーポイントVBA拡張

例:

文:こんにちは私の名前はvinodです。私はハイデラバード出身です。

プログラム: 文の中にhelloという単語がある場合。 完全な文章 "こんにちは私の名前はvinodです。私はハイデラバード出身です。"

単語VBAで拡張を使用するプログラムが見つかりました。 パワーポイントにも同じものを使いたいです。 ここに参照用のコードへのリンクがある

Extract sentences containing a specific word to excel file

答えて

1

あなたがTextRange

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 
Sentences属性を使用することができます
関連する問題