SetExternalHyperlinkClick

HyperlinkManager.SetExternalHyperlinkClick method

Establecer un hipervínculo externo al hacer clic.

public IHyperlink SetExternalHyperlinkClick(string url)
ParámetroTipoDescripción
urlStringURL del hipervínculo.

Ejemplos

El siguiente código de muestra muestra cómo agregar un cuadro de texto con hipervínculo.

[C#]
// Instancia una clase Presentation que representa un PPTX
using(Presentation pptxPresentation = new Presentation()) {
  // Obtiene la primera diapositiva en la presentación
  ISlide slide = pptxPresentation.Slides[0];
  // Agrega un objeto AutoShape con el tipo establecido como Rectángulo
  IShape pptxShape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 150, 150, 150, 50);
  // Convierte la forma a AutoShape
  IAutoShape pptxAutoShape = (IAutoShape) pptxShape;
  // Accede a la propiedad ITextFrame asociada con el AutoShape
  pptxAutoShape.AddTextFrame("");
  ITextFrame textFrame = pptxAutoShape.TextFrame;
  // Agrega algún texto al marco
  textFrame.Paragraphs[0].Portions[0].Text = "Aspose.Slides";
  // Establece el hipervínculo para el texto de la porción
  IHyperlinkManager HypMan = textFrame.Paragraphs[0].Portions[0].PortionFormat.HyperlinkManager;
  HypMan.SetExternalHyperlinkClick("http://www.aspose.com");
  // Guarda la presentación PPTX
  pptxPresentation.Save("hLinkPPTX_out.pptx", Aspose.Slides.Export.SaveFormat.Pptx);
}

Ver También