Home > Back-end >  Demon elder brother, how to get the second slide inside how many objects?
Demon elder brother, how to get the second slide inside how many objects?

Time:10-06

Hello, demon elder brother, or the problem, http://bbs.csdn.net/topics/390850793? Page=1 # post - 397919561

Is how to get the second slide inside how many data (placeholder? The object? ,

If I bulk modify PPT, he is not the same as the number of each slide the data inside the

Have a plenty of two images one paragraph, have a plenty of 3 paragraph 2 pictures, etc.

If the definition was dead, they went wrong,

Looking forward to reply * (Delphi), thank you.

CodePudding user response:

 PowerPointSlide1. Shapes. Count 

CodePudding user response:

reference 1st floor ccrun response:
 PowerPointSlide1. Shapes. Count 


 procedure TForm1. Button1Click (Sender: TObject); 
Var
I: integer;
The begin
//start PowerPoint
PowerPointApplication1. Connect;

//convenient for debugging, set its visual interface
PowerPointApplication1. Visible:=msoTrue;

//open an existing PPT document
PowerPointPresentation1. ConnectTo (PowerPointApplication1. Presentations. The Open
(' D: \ \ Desktop \ PPT 3. PPT ', msoFalse, msoFalse, msoTrue));

If PowerPointPresentation1. Slides TAB. Count & gt; 1 then
The begin
//position to the next slide
PowerPointSlide1. ConnectTo (PowerPointPresentation1. Slides TAB. The Item (2));
//fill out the second slide two text box
If PowerPointSlide1. Shapes. Count & gt; 1 then
The begin
With PowerPointSlide1 do
The begin
Layout:=3;//type 3 is a text
FollowMasterBackground:=0;//set the background
I:=Shapes. Count + 1;
//get data from the second slide has three, and then I + 1, create a fourth, and add on the data, but prompt cross-border,
Shapes. The Item (I). TextFrame. TextRange. Text:=Edit1. Text;
Shapes. The Item (I). TextFrame. TextRange. The Font. The Name:='Arial';
Shapes. The Item (I). TextFrame. TextRange. The Font, size:=1.5;
Shapes. The Item (I). TextFrame. TextRange. The Font, Color, RGB:=RGB (255, 255, 255);
Shapes. The Item (I). Left:=10;
Shapes. The Item (I). Top:=10;
Shapes. The Item (I). Width:=50;
Shapes. The Item (I). Height:=10;
end;
end;
end;
end;


Hint of crossing the line, demon elder brother, can only be added to an existing object? Cannot create a new object, and writing data?

CodePudding user response:

Tip cross this question, you PowerPointPresentation1 and PowerPointSlide1 ever have a relationship? If two objects are strangers, not crossing the line no,

CodePudding user response:


I feel PowerPointPresentation1 and PowerPointSlide1 has little to do here,

 with PowerPointSlide1 do 
The begin
Layout:=3;//type 3 is a text
FollowMasterBackground:=0;//set the background
I:=Shapes. Count + 1;
//this error area, such as slide 2 three text boxes inside the
//if not + 1, will append data at the third text box,
//if the + 1, is to create a fourth text box and write data, but he said that only three, can't make a fourth,
Shapes. The Item (I). TextFrame. TextRange. Text:=Edit1. Text;
Shapes. The Item (I). TextFrame. TextRange. The Font. The Name:='Arial';
Shapes. The Item (I). TextFrame. TextRange. The Font, size:=1.5;
Shapes. The Item (I). TextFrame. TextRange. The Font, Color, RGB:=RGB (255, 255, 255);
Shapes. The Item (I). Left:=10;
Shapes. The Item (I). Top:=10;
Shapes. The Item (I). Width:=50;
Shapes. The Item (I). Height:=10;
end;

CodePudding user response:

CodePudding user response:

Seems to be done, should first create a TXT text boxes, write again,
 Shapes. AddTextbox (msoTextOrientationHorizontal, 10,10,100,15); 

CodePudding user response:

First of all, PowerPointPresentation1 must with PowerPointSlide1 set properties (both design and runtime)
Second, the subscript begins with 1 in the Office,

CodePudding user response:

thank you demon elder brother, I thought is also starting from 0,
  • Related