forked from rozenasf/Matlab2Powerpoint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddTextToSlide.m
More file actions
33 lines (27 loc) · 981 Bytes
/
AddTextToSlide.m
File metadata and controls
33 lines (27 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function U = AddTextToSlide(Slide,Info)
% U = Slide.Shapes.AddTextbox(1,Info.Left,Info.Top,Info.Width,Info.Height);
U = Slide.Shapes.AddTextbox(1,Info.Left,Info.Top,Info.Width,Info.Height);
if(isfield(Info, 'Text'));
U.TextFrame.TextRange.Text = Info.Text;
end
if(isfield(Info, 'Name'));
U.TextFrame.TextRange.Font.Name = Info.Name;
else
U.TextFrame.TextRange.Font.Name = 'Times New Roman';
end
if(isfield(Info, 'Size'));
U.TextFrame.TextRange.Font.Size = Info.Size;
else
U.TextFrame.TextRange.Font.Size = 24;
end
if(isfield(Info, 'Color'));
U.TextFrame.TextRange.Font.Color.RGB = RGB_int(Info.Color);
end
if(isfield(Info, 'Spacing'));
U.TextFrame2.TextRange.Font.Spacing=Info.Spacing;
% else
% U.TextFrame2.TextRange.Font.Spacing = 0.8;
end
U.TextFrame.TextRange.ParagraphFormat.Alignment = 'ppAlignCenter';
Slide.invoke;
end