Skip to main content
Skip table of contents

existsComponent

Versionshinweise

22.1, 21.2.06, 21.1.11

Code

GROOVY
existsComponent(PresentationDocument document, String identifier, int pageIndex, int paragraphIndex, int portionIndex)

Beschreibung

Prüft, ob die angegebene Textkomponente in der übergebenen Präsentationsdatei existiert.

Parameter

  • document

    Repräsentiert die Präsentationsdatei
  • identifier
    Name der Textkomponente
  • pageIndex
    Index der Seite, auf der sich die Textkomponente befindet (erste Seite startet mit 1)
  • paragraphIndex

    Optionaler Parameter zur Adressierung auf Absatzebene
    Index des Absatzes (erster Absatz startet mit 1). Eine Textkomponente kann mehrere Absätze enthalten.

  • portionIndex 
    Optionaler Parameter zur Adressierung auf Ebene eines Textfragments
    Index eines formatierten Textfragments in einer Zeile (erstes Textfragment startet mit 1). Eine Zeile kann mehrere formatierte Textfragmente enthalten.

Rückgabe
Liefert true, wenn die referenzierte Textkomponente in der übergebenen Präsentationsdatei existiert, ansonsten false.

Beispiele

GROOVY
IPresentationResult openResult = PresentationUtils.openFile("C:\\Work\\myFirstPresentation.ppsx");

if (!PresentationUtils.isSuccessful(openResult))
{
	/** handle error code */
    return;
}

PresentationDocument presentation = null;
try
{
  presentation = PresentationUtils.getPresentationDocument(openResult);

  String identifier = "myTitle";
  int pageIndex = 1;
  int paragraphIndex = 1;
  int portionindex = 3;

  if (PresentationUtils.existsComponent(presentation, identifier, pageIndex, paragraphIndex, portionindex))
  {
       String value = PresentationUtils.getValue(presentation, identifier, pageIndex, paragraphIndex, portionindex);
  }
  ...
}
finally
{
  PresentationUtils.close(presentation);
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.