fn:contains(string, substring)
如果參數string中包含參數substring,返回true

fn:containsIgnoreCase(stringsubstring)
如果參數string中包含參數substring(忽略大小寫),返回true

fn:endsWith(stringsuffix)
如果參數 string 以參數suffix結尾,返回true

fn:escapeXml(string)
將有意義的XML (和HTML)轉換為對應的XML character entity code,並返回

fn:indexOf(stringsubstring)
返回參數substring在參數string中第一次出現的位置

fn:join(arrayseparator)
將array陣列項目用一給定的separator字串串在一起,組成新字串並返回。

fn:length(item)
返回item元素長度。

fn:replace(stringbeforeafter)
用參數after字串去替換string中所有出現參數before的字串,並返回其結果

fn:split(stringseparator)
以參數separator 分割string,返回一陣列

fn:startsWith(stringprefix)
如果參數string以參數prefix開頭,返回true

fn:substring(stringbeginend)
返回參數stringy部分的字串,從參數begin開始到參數end,包括end位置的字串

fn:substringAfter(stringsubstring)
返回參數substring在參數string中~後面的字串

fn:substringBefore(stringsubstring)
返回參數substring在參數string中前面的那一部份的字串

fn:toLowerCase(string)
將參數string所有字元轉換驗小寫,並返回其字串

fn:toUpperCase(string)
將參數string所有字元轉換驗大寫,並返回其字串

fn:trim(string)
去除參數string 首尾的空白,並返回其字串

ActiveXComponent axc = new ActiveXComponent(『PowerPoint.Application』);
// 以下process是否可見
axc.setProperty(『Visible』, new Variant(true));
Dispatch presentations = axc.getProperty(『Presentations』).toDispatch();
Dispatch presentation = Dispatch.call(presentations, 『Add』, 
                                                                   new Variant(true)).toDispatch();

//  取用一個Template file
Dispatch.call(presentation, 『ApplyTemplate』, 『Template filePathName『);
Dispatch slides = Dispatch.get(presentation, 『Slides』).toDispatch();
Dispatch slide = Dispatch.call(slides, 『Add』, 『1″, 『11″).toDispatch();
Dispatch shapes = Dispatch.call(slide, 『Shapes』).toDispatch();
Variant shape1 = Dispatch.callN(shapes, 『AddPicture』, 
                                            new Variant[] {new Variant(『圖檔pathfile』), 
                                            new Variant(false), new Variant(是否以連結方式使用該檔),
                                            new Variant(Left座標), new Variant(Top座標), 
                                            new Variant(寛度), new Variant(高度) });

Dispatch documentWindow  = axc.getProperty(『ActiveWindow』).toDispatch();
Dispatch view = documentWindow.call(documentWindow,』View』).toDispatch();
view.put(view,』Zoom』,new Variant(83));

Dispatch shape = Dispatch.call(slide, 『Shapes』, new Variant(1)).toDispatch();
String shapeName1 = Dispatch.get(shape,』Name』).toString();
        
Dispatch shape2 = Dispatch.call(slide, 『Shapes』, new Variant(2)).toDispatch();
String shapeName2 = Dispatch.get(shape2,』Name』).toString();
String type = Dispatch.get(shape2, 『Type』).toString();

Dispatch.callN(shape2, 『ScaleHeight』, new Variant[] {
                                                                                               new Variant(1), 
                                                                                               new Variant(true), 
                                                                                               new Variant(0)});
       
Dispatch.callN(shape2, 『ScaleWidth』, new Variant[] {
                                                                                               new Variant(1), 
                                                                                               new Variant(true), 
                                                                                               new Variant(0)});

Blog Stats

  • 230 hits

網誌分頁

Follow

Get every new post delivered to your Inbox.