Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hi,
How to add hyperlink to a text using Microsoft.Office.Interop.Powerpoint.slide class?
Below is the sample code for adding textbox.
int s32_Left = Functions.GetRemoveAttribInt(x_Shape.Name, i_Properties, "Left", null);
int s32_Top = Functions.GetRemoveAttribInt(x_Shape.Name, i_Properties, "Top", null);
int s32_Width = Functions.GetRemoveAttribInt(x_Shape.Name, i_Properties, "Width", null);
int s32_Height = Functions.GetRemoveAttribInt(x_Shape.Name, i_Properties, "Height", 1);
i_Shape = i_Slide.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, s32_Left, s32_Top, s32_Width, s32_Height);
By using Slide class, how to add hyperlink to text?
 
thanks in advance....
Posted 8-Jan-13 4:10am
Edited 8-Jan-13 4:33am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try this:
 
app.ActiveWindow.Selection.TextRange.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Hyperlink.Address = "http://www.google.com";
 
[Reference^]
  Permalink  
Comments
nareshkumar464 at 8-Jan-13 9:50am
   
want code using slide class in powerpoint namespace but not by using app.
BC @ CV at 8-Jan-13 9:52am
   
So....
PowerPoint.Application app = slide.Application;
nareshkumar464 at 10-Jan-13 4:51am
   
Hi, I tried as you said but got error as mentioned below:
"Selection (unknown member) : Invalid request. Nothing appropriate is currently selected."
BC @ CV at 10-Jan-13 11:04am
   
You have to select it first:
app.ActiveWindow.Selection.TextRange.Select();
 
Read this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Mika Wendelius 161
1 Kornfeld Eliyahu Peter 105
2 Zoltán Zörgő 100
3 Abhinav S 95
4 Suvendu Shekhar Giri 95
0 Sergey Alexandrovich Kryukov 8,513
1 OriginalGriff 6,526
2 Peter Leow 3,657
3 Zoltán Zörgő 3,426
4 Richard MacCutchan 2,417


Advertise | Privacy | Mobile
Web02 | 2.8.150123.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100