de onderstaande code maakt een powerpoint aan met 1 slide. Echter ik wil bij deze slide notes toe kunnen voegen
(later dynamisch, maar nu nog hard).
de code(asp) volgens microsoft heb ik al, zie code, maar hoe doe ik dat in cold fusion?
weet 1 van jullie het?
(later dynamisch, maar nu nog hard).
de code(asp) volgens microsoft heb ik al, zie code, maar hoe doe ik dat in cold fusion?
weet 1 van jullie het?
code:
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
| <CFTRY>
<!--- If it exists, connect to it --->
<CFOBJECT ACTION="CONNECT" CLASS="PowerPoint.Application" NAME="objPPT" TYPE="COM">
<CFCATCH>
<!--- The object doesn't exist, so create it --->
<CFOBJECT ACTION="CREATE" CLASS="PowerPoint.Application" NAME="objPPT" TYPE="COM">
</CFCATCH>
</CFTRY>
<CFSCRIPT>
// Get the presentations collection
objPresentations = objPPT.Presentations;
// Open a presentation
objPresentation = objPresentations.Open("c:\inetpub\powerpoint.ppt", False, False, False);
mySlides = objPresentation.Slides;
newSlide = mySlides.Add(1, 1);
slideShape = newSlide.Shapes;
newShape = slideShape.Title;
myTextFrame = newShape.TextFrame;
myTextRange = myTextFrame.TextRange;
myTextRange.Text = "This is a miracle!";
// This is how to add more text to the slide.
bodyShape = SlideShape.AddTextBox(1, 200, 300, 700, 100);
bodyShapeTextFrame = bodyShape.TextFrame;
bodyShapeTextRange = bodyShapeTextFrame.TextRange;
bodyShapeTextRange.Text = "If you've come this far, maybe you're willing to come a bit farther.";
//poging om notes aan een 2e slide toe te voegen
//werkt echter niet.
newSlide3 = mySlides.Add(2, 1);
a1 = newSlide3.Notespage;
a2 = a1.Shapes;
a3 = a2.Placeholders(1);
a3.InsertAfter = "This is the title text";
//volgens microsoft moet het zo:
//ActivePresentation.Slides(1).NotesPage.Shapes _
// .Placeholders(2).TextFrame.TextRange.InsertAfter "Added Text"
// Save a presentation
newpresentation = objPresentation.SaveAS("c:\inetpub\test.ppt",11, True);
objPresentation.Close();
objPPT.Quit();
</CFSCRIPT> |