javaÉú³Édoc html
javaÉú³Éword,htmlÎļþ²¢½«ÄÚÈݱ£´æÖÁÊý¾Ý¿â
Posted on 2005-12-15 17:19 Kela ÔĶÁ(3126) ÆÀÂÛ(3) ±à¼ ÊÕ²Ø
ÔÚ×î½üµÄÒ»¸öÏîÄ¿ÖÐÐèÒª½«Ò»¶Î×Ö·ûÀàÐ͵ÄÎı¾´æΪword£¬html²¢Òª½«wordµÄÄÚÈݱ£´æÔÚÊý¾Ý¿âÖУ¬ÓÚÊǾÍÓÐÁËÈçϵÄÒ»¸ö¹¤¾ßÀ࣬ϣÍûÄܶÔÅöµ½ÕâÑùÐèÇóµÄÅóÓÑÌṩµã°ïÖú¡£
´Ò´ÒææµÄ¾ÍcopyÉÏÀ´ÁË£¬Ã»ÓÐ×öһЩɾ¼õ£¬ÓÐһЩ¶àÓàµÄ¶«Î÷£¬ÓÐÐËȤµÄÅóÓÑ¿ÉÒÔ×ÔÐÐÂÔÈ¥¡£ÎÒµÄ×¢ÊÍÏà¶Ô±È½ÏÇå³þ£¬¿ÉÒÔ°´ÕÕ×Ô¼ºµÄÐèÇó½øÐÐ×éºÏ¡£
ÔÚ²Ù×÷wordµÄµØ·½Ê¹ÓÃÁËjacob(jacob_1.9)£¬Õâ¸ö¹¤¾ßÍøÉϺÜÈÝÒ×ÕÒµ½£¬½«jacob.dll·ÅÖÃϵͳPathÖУ¬Ö±½Ó·ÅÔÚsystem32ÏÂÒ²¿ÉÒÔ£¬jacob.jar·ÅÖÃÔÚclassPathÖС£
´úÂëÈçÏ£ºWordBridge.java
/**
* WordBridge.java
*/
package com.kela.util;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
import com.kela.db.PoolingDataSource;
/**
* ˵Ã÷: ¶ÔwordµÄ²Ù×÷ <p>
*
* @author kela.kf@gmail.com
*/
public class WordBridge {
Log log = LogFactory.getLog("WordBridgt");
private ActiveXComponent MsWordApp = null;
private Dispatch document = null;
/**
* ´ò¿ªword
* @param makeVisible, trueÏÔʾword, false²»ÏÔʾword
 
Ïà¹ØÎĵµ£º
1. ÔÚCÓïÑÔÖУ¬ÎÒÃÇͨ³£Ï°¹ß°ÑÐèÒªµÄ¶ÔÏóÉêÃ÷·ÅÔÚº¯ÊýµÄ¿ªÍ·£¬µ«ÆäʵÕâÊÇ°×°×ÀË·ÑÁËÄڴ棬ÔÚJavaÖУ¬²»µ½ÐèÒªµÄʱºò£¬Çë²»Òª´´½¨¶ÔÏó¡£
2. À¬»ø»ØÊջ᲻¶¨ÆÚµÄËÑË÷ÒѾûÓÐÓõĶÔÏó£¬È»ºóÊͷŶÔÏóµÄÄڴ棬µ«ÕâÖÖËÑË÷ÊDZȽϺÄ×ÊÔ´µÄ¡£ÎªÌá¸ßЧÂÊ£ ......
18.×öÒ»¸öµ¥×ÓģʽµÄÀֻ࣬¼ÓÔØÒ»´ÎÊôÐÔÎļþ
package com.softeem.demo;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
*@authorleno
*µ¥×Óģʽ£¬±£Ö¤ÔÚÕû¸öÓ¦ÓÃÆÚ¼äÖ»¼ÓÔØÒ ......
//±¾³ÌÐòÁ¬½ÓµÄÊÇsql server 2005£¬ÓëÁ¬½Ósql server 2000Óе㲻ͬ£ºdriverNameºÍURL¶¼²»Í¬
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class create{
public void getConnection() th ......
³ÌÐòÔ´´úÂ룺
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JOptionPane; ......
Ô´³ÌÐò´úÂ룺
import java.awt.Color;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionAdapter;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
......