creating ArrowConnector from PowerPoint Object Library in C#

A

Adeel

Hello, This is Adeel! Well i'm a software developer here in Pakistan working
on Microsoft C#. Can you u plz help me out i have a problem in creating an
ARROW-CONNECTOR SHAPE using Microsoft PowerPoint Object through Code. I'm
generating a Dynamic Presentation from my Application. Looking forward
towards ur Reply..

I do have a code for VB6 with i'm able to generate it but i cudn't find help
or documentation for .NET platform that makes it hard to access these COM
components.


Sample Code
---------------
ActiveWindow.Selection.SlideRange.Shapes.AddConnector(msoConnectorStraight,
156#, 456#, 156#, 30#).Select
ActiveWindow.Selection.ShapeRange.Line.EndArrowheadStyle =
msoArrowheadTriangle
ActiveWindow.Selection.SlideRange.Shapes.AddConnector(msoConnectorElbow,
234#, 84#, 192#, 60#).Select
With ActiveWindow.Selection.ShapeRange
.Line.BeginArrowheadStyle = msoArrowheadTriangle
.Line.EndArrowheadStyle = msoArrowheadTriangle
End With




If anyone can help in convert/creating ArrowConnector from this sample code
so plzz reply me (e-mail address removed) or here at Forum

Regards

Adeel...
 
S

Shyam Pillai

Adeel,
Add the appropriate references:
// C# code to generate a connector shape
PowerPoint.Application ppApp ;
PowerPoint.Presentation ppPres;
PowerPoint.Slide ppSld;
PowerPoint.Shape ppShape;
ppApp=new PowerPoint.ApplicationClass();

ppApp.Visible = Microsoft.Office.Core.MsoTriState.msoCTrue;
ppPres =
ppApp.Presentations.Add(Microsoft.Office.Core.MsoTriState.msoCTrue);
ppSld = ppPres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutTitle);
ppShape =
ppSld.Shapes.AddConnector(Microsoft.Office.Core.MsoConnectorType.msoConnectorElbow,
0, 0, 100, 100);
ppShape.Line.BeginArrowheadStyle =
Microsoft.Office.Core.MsoArrowheadStyle.msoArrowheadTriangle;
ppShape.Line.EndArrowheadStyle =
Microsoft.Office.Core.MsoArrowheadStyle.msoArrowheadTriangle;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top