文件名称:java操作word(代码大全)
文件大小:254KB
文件格式:DOC
更新时间:2014-01-05 07:36:30
java 操作word
/** *//** * 设置当前选定内容的字体 * * @param boldSize * @param italicSize * @param underLineSize 下划线 * @param colorSize 字体颜色 * @param size 字体大小 * @param name 字体名称 */ public void setFont(boolean bold, boolean italic, boolean underLine, String colorSize, String size, String name) { Dispatch font = Dispatch.get(selection, "Font").toDispatch(); Dispatch.put(font, "Name", new Variant(name)); Dispatch.put(font, "Bold", new Variant(bold)); Dispatch.put(font, "Italic", new Variant(italic)); Dispatch.put(font, "Underline", new Variant(underLine)); Dispatch.put(font, "Color", colorSize); Dispatch.put(font, "Size", size); }