Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Sun May 15, 2016 6:55 pm

Need VB code for creating an header and textbox in each slide + Inserting text in each of these boxes.
Also need to leave the textboxes without a border line / no color border line.

Thanks a lot!

kdr13
 
Posts: 72
Joined: Fri Apr 15, 2016 4:35 pm

Mon May 16, 2016 8:47 am

Hi,

Thanks for your posting.
Sorry that we don't support to add header and textboxes. But a rectangle shape has nearly same functions as textbox, I recommand you to use rectangle shapes if you can.
Sharing some code to add rectangle shape:
Code: Select all
     Dim shape As IAutoShape = presentation.Slides(0).Shapes.AppendShape(ShapeType.Rectangle, New RectangleF(10, 10, 200, 100))

    shape.Fill.FillType = FillFormatType.Solid
    shape.Fill.SolidColor.Color = Color.White
    shape.ShapeStyle.LineColor.Color = Color.White

    shape.AppendTextFrame("Demo of Spire.Presentation")
    Dim textRange As TextRange = shape.TextFrame.TextRange
    textRange.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.Solid
    textRange.Fill.SolidColor.Color = Color.Black


Please feel free to contact us if you need further assistance.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Tue May 17, 2016 4:57 am

Thank you!

I'm using different images as background for the slides so I'd like to make the text boxes /rectangle border transparent/no color - regardless of the specific background image color Kindly guide me how to do that.

Thank you in advance!

kdr13
 
Posts: 72
Joined: Fri Apr 15, 2016 4:35 pm

Tue May 17, 2016 6:52 am

Hi,

Please try the following code.
Code: Select all
 RectangleF rect = new RectangleF(0, 0, presentation.SlideSize.Size.Width, presentation.SlideSize.Size.Height);
            presentation.Slides[0].SlideBackground.Fill.FillType = FillFormatType.Picture;

            IEmbedImage image = presentation.Slides[0].Shapes.AppendEmbedImage(ShapeType.Rectangle, ImageFile, rect);
            image.Line.FillFormat.FillType = FillFormatType.None;
            presentation.Slides[0].SlideBackground.Fill.PictureFill.Picture.EmbedImage = image as IImageData;


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Tue May 17, 2016 6:34 pm

Can you please specify what each one of the numbers in the next code section represents?

RectangleF(10, 10, 200, 100)

Thank you!

kdr13
 
Posts: 72
Joined: Fri Apr 15, 2016 4:35 pm

Wed May 18, 2016 1:53 am

Hi,

//x, y represent x, y coordinates
//width represents shape's width
//height represents shape's height
RectangleF(float x, float y, float width, float height)

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Presentation