How to open MSWORD using JAVA/JNI and write the database entries into WORD

Hi..
I am searching for java codes that uses JAVA NATIVE INTERFACE (JNI) for opening MSWORD 2003.
To be brief.
I created HTML form called Employee_data.
if i click on Submit button a word document should be opened.This should be using JNI.
I have also created a servlet in jsp to process the form data and store it into database(mysql).;
Please help me to find the codes to open MSWORD on submit click and to write the database entries into word file.Can i get the full code for that.This is so urgent.
Thanks in advance.

Hi Suresh,
The easest solution I can think of is to copy the math equation from the PowerPoint then paste in the Word document directly, there's actually no way to convert it to plain text, some equation is very complext, String variable is not suitable in this case.
For example, this code works fine:
var powerPoint = new Application { WindowState = PpWindowState.ppWindowMinimized };
var oPresSet = powerPoint.Presentations;
Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(@"C:\test.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
var strObj = oPres.Slides[1].NotesPage.Shapes[2].TextFrame2.TextRange.MathZones.get_MathZones();
strObj.Copy();
Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = true;
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Add();
doc.Range(0, 0).Paste();
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to send attachments using java application and outlook

    Hi ,
    I created an application in java which is as
    on the Conference Tab i can schedule a conference and with the send command on page it map all the scheduled data to outlook(with all conference details) and using outlook send option the mails are send to appropriate user.
    but now i want to modify this application such as when i use the send command from my jsp page it should attach the file that is in .vcs or .ics format for auto updation of user calender.
    can any one know how to send attachment using java application .

    Last time I checked, SMS was a service between carriers and doing SMS yourself was really tricky. Some services existed to let you do it but as I recall they wanted non-trivial money.
    However, most phone carriers provide an email-to-SMS bridge of some kind.
    So the easiest thing is just to send an email.
    That's sending from a non-phone to a phone. There's a J2ME library to send/receive SMS from/to a phone.
    However, this is from memory, and a little out of date, so I could be entirely wrong. Hope it helps anyway.

  • How CallableStatement in JSP use setDate() method to insert the date value into DB?

    Dear all,
    I met a strange error message when i insert a date value into DB via JSP call PL/SQL procedures.
    The error seems caused by the setDate(index, date) method with CallableStatement.
    The message is: Can not find the setDate(int, java.util.Date) method in the CallableStatement interfaces.
    Any ideas?
    Thanks advanced.

    Thank you!:)
    I solved it using this:
    String name="david";
                stmt = con1.createStatement();
                String prikaz1 = "INSERT INTO table (id,age,surname,name) IN 'C:\\Users\\David\\Desktop\\db.mdb' SELECT id,age,surname,' " + name + " ' FROM table2";
                stmt.executeUpdate(prikaz1);

  • This is a hw assignment how do i create a layer mask and make the image fade into a white background

    I would like to know how to do this as soon as possible thank u!!

    i tried to understand it in the book i still dont understand and i do not have the notes because i was absent the day the professor discussed it

  • To detect and write the midi imput into an ini file

    greetings
    for some experimental programming purposes, I need to have an ini file with only one value within, detecting the current pressed key of the midi keyboard connected to the PC trough midi interface.
    So that value should change in real time while the user plays the instrument.
    If possible to do this with Java + there are already some java programs who could do this?

    greetings
    for some experimental programming purposes, I need to have an ini file with only one value within, detecting the current pressed key of the midi keyboard connected to the PC trough midi interface.
    So that value should change in real time while the user plays the instrument.
    If possible to do this with Java + there are already some java programs who could do this?

  • How do I remove disk partition and merge the 2 partitions into main hard disk C drive. Win7

    How do I remove a disk  partition  and merge the 2 partitions into main hard disk C drive. If I delete Drive  D I am left with 250G of unallocated space in drive D Hard drive. And I want the unallocated portion 250G to be allocated
    to the C drive.jc

    I know it is a little bit late to reply. But, I still want to share my experiences with everyone here.
    Actually, I have ever also has the same issue and needed to resize my C drive partition for much more partition space. But, the resizing process just unexpectedly fails at last in Disk Management. The “extend” function is unable to work.
    So, I have no choice but to take chances with some third party partition resizing tools:
    GParted
    http://gparted.sourceforge.net/
    IM-Magic Partition Resizer Free
    http://www.resize-c.com/
    Both of them seem efficient. So, I just have tried them one by one and finally added wanted free space to my C drive successfully.
    I even have found a video tutorial that teaches me how to resize my drive with this freeware in details:
    https://www.youtube.com/watch?v=6jCeT7CbsKk

  • How to write the JTables Content into the CSV File.

    Hi Friends
    I managed to write the Database records into the CSV Files. Now i would like to add the JTables contend into the CSV Files.
    I just add the Code which Used to write the Database records into the CSV Files.
    void exportApi()throws Exception
              try
                   PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
                   System.out.println("Connected");
                   stexport=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                   rsexport=stexport.executeQuery("Select * from IssuedBook ");
                   ResultSetMetaData md = rsexport.getMetaData();
                   int columns = md.getColumnCount();
                   String fieldNames[]={"No","Name","Author","Date","Id","Issued","Return"};
                   //write fields names
                   String rec = "";
                   for (int i=0; i < fieldNames.length; i++)
                        rec +='\"'+fieldNames[i]+'\"';
                        rec+=",";
                   if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                   writing.println(rec);
                   //write values from result set to file
                    rsexport.beforeFirst();
                   while(rsexport.next())
                        rec = "";
                         for (int i=1; i < (columns+1); i++)
                             try
                                    rec +="\""+rsexport.getString(i)+"\",";
                                    rec +="\""+rsexport.getInt(i)+"\",";
                             catch(SQLException sqle)
                                  // I would add this System.out.println("Exception in retrieval in for loop:\n"+sqle);
                         if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                        writing.println(rec);
                   writing.close();
         }With this Same code how to Write the JTable content into the CSV Files.
    Please tell me how to implement this.
    Thank you for your Service
    Jofin

    Hi Friends
    I just modified my code and tried according to your suggestion. But here it does not print the records inside CSV File. But when i use ResultSet it prints the Records inside the CSV. Now i want to Display only the JTable content.
    I am posting my code here. Please run this code and find the Report.csv file in your current Directory. and please help me to come out of this Problem.
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    public class Exporting extends JDialog implements ActionListener
         private JRadioButton rby,rbn,rbr,rbnore,rbnorest;
         private ButtonGroup bg;
         private JPanel exportpanel;
         private JButton btnExpots;
         FileReader reading=null;
         FileWriter writing=null;
         JTable table;
         JScrollPane scroll;
         public Exporting()throws Exception
              setSize(550,450);
              setTitle("Export Results");
              this.setLocation(100,100);
              String Heading[]={"BOOK ID","NAME","AUTHOR","PRICE"};
              String records[][]={{"B0201","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0202","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0203","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0204","PRIAM","SELVI","1354"},
                               {"B0205","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0206","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0207","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0208","PRIAM","SELVI","1354"}};
              btnExpots= new JButton("Export");
              btnExpots.addActionListener(this);
              btnExpots.setBounds(140,200,60,25);
              table = new JTable();
              scroll=new JScrollPane(table);
              ((DefaultTableModel)table.getModel()).setDataVector(records,Heading);
              System.out.println(table.getModel());
              exportpanel= new JPanel();
              exportpanel.add(btnExpots,BorderLayout.SOUTH);
              exportpanel.add(scroll);
              getContentPane().add(exportpanel);
              setVisible(true);
          public void actionPerformed(ActionEvent ae)
              Object obj=ae.getSource();
              try {
              PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
              if(obj==btnExpots)
                   for(int row=0;row<table.getRowCount();++row)
                             for(int col=0;col<table.getColumnCount();++col)
                                  Object ob=table.getValueAt(row,col);
                                  //exportApi(ob);
                                  System.out.println(ob);
                                  System.out.println("Connected");
                                  String fieldNames[]={"BOOK ID","NAME","AUTHOR","PRICE"};
                                  String rec = "";
                                  for (int i=0; i <fieldNames.length; i++)
                                       rec +='\"'+fieldNames[i]+'\"';
                                       rec+=",";
                                  if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                                  writing.println(rec);
                                  //write values from result set to file
                                   rec +="\""+ob+"\",";     
                                   if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                                   writing.println(rec);
                                   writing.close();
         catch(Exception ex)
              ex.printStackTrace();
         public static void main(String arg[]) throws Exception
              Exporting ex= new Exporting();
    }Could anyone Please modify my code and help me out.
    Thank you for your service
    Cheers
    Jofin

  • I downloaded mountain lion and then the new office suite (word, ppt, excel) but now when I try to display one of my ppt's it says 'ppt cannot open the file...the file may be corrupt, in use, not a type recognized by ppt etc.." how can I fix it?? HELP

    I downloaded mountain lion and then the new office suite (word, ppt, excel) but now when I try to display one of my ppt's it says 'ppt cannot open the file...the file may be corrupt, in use, not a type recognized by ppt etc.." how can I fix it?? HELP

    Did you try to open teh fle by double-clicking its icon? If the file was made with an older version of Office, you may get that message. Try opeing PP and, from its "File" menu, see if you can open the ppt. I've foundthat often gets around that message and then yo ucan save the file from the newer version.
    If that doesn't work, consider asking in the Microsoft Office: Mac forums here:
    Office for Mac forums
    PowerPoint is not an Apple product and it seems a lot of people around here avoid Office.

  • How to use java 6 and uninstall java 7 ?

    Curently I'm facing some problem uninstall java 7, whenever I delete java 7 and install java 6,  when i check on my java -version it is showing java version "1.7.0_09".
    How can use java 1.6 instead of 1.7 ? Please help thanks.

    The following article should show you how:
       https://service.parachat.com/knowledgebase/226/How-can-I-uninstall-Oracle-Java-7 -and-reinstall-Apples-Java-6-on-my-Mac.html
    Hope this helps

  • I am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier

    i am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier photo please help me to recover my photos

    Well I'll guess you're using iPhoto 11:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • I tried to open my Illustrator CS6 today and got the following error message, "To open Adobe Illustrator CS6 you need to install the legacy Java SE runtime". The window then states, "Click More info...to visit the legacy Java SE 6 download website."  I do

    Help. I tried to open my Illustrator CS6 today and got the following error message, "To open Adobe Illustrator CS6 you need to install the legacy Java SE runtime". The window then states, "Click More info...to visit the legacy Java SE 6 download website."  I do click on the More Info... button, but the webpage is blank. Please help.
    Thanks,
    Leo

    Leo,
    Depending on your OS, you should be able to use;
    Win:
    http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419 409.html
    Mac:
    http://support.apple.com/kb/DL1572
    Some have found that the page may turn up blank to start with, so it may be necessary to reload the page.
    Others have found that it may depend on browser. Specifically, a switch from Safari has solved it in one case.

  • Want the link to open EAS IN WEb mode and also the Java API details needed

    Want the link to open EAS IN WEb mode and also the Java API details needed to get it up and running.
    Kindly provide the answer if knows.
    Thanks .

    Yes, you can have single sign on enabled on multiple essbase servers,
    It works like using single userid and password across mulple servers. you can configure essbase server to read from active directory.
    you can configure css.xml file in bin folder
    sample CSS FILE
    here is an example of a css.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <css xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <spi>
    <provider>
    <msad name="msad1"> <trusted>false</trusted>
    <url>ldap://ldapserver:389/dc=CompanyName,dc=com</url>
    <userDN>CN=#######,OU=Security Accounts,OU=IT,DC=CompanyName,DC=com</userDN>
    <password>########</password>
    <authType>simple</authType>
    <identityAttribute>dn</identityAttribute>
    <user>
    <loginAttribute>sAMAccountName</loginAttribute>
    <fnAttribute>givenname</fnAttribute>
    <snAttribute>sn</snAttribute>
    <emailAttribute>mail</emailAttribute>
    <objectclass>
    </objectclass>
    </user>
    <group>
    <url>cn=LostAndFound</url>
    </group>
    </msad>
    </provider>
    </spi>
    <searchOrder>
    <el>msad1</el>
    </searchOrder>
    <token>
    <timeout>60</timeout>
    </token>
    <logger>
    <priority>ERROR</priority>
    </logger>
    </css>

  • My iphone 5s was stolen and i gps d it and found where it was but they turned it off and denied it and i googled how to open iphone 5s without passcode and a youtube video showed how, so now i am out of a phone that i just paid 300 dollars for becaus

    my iphone 5s was stolen and i gps d it and found where it was but they turned it off and denied it and i googled how to open iphone 5s without passcode and a youtube video showed how, so now i am out of a phone that i just paid 300 dollars for because i dropped my last 5s and the glass shattered and i didnt have any insurance. so now it seems like i am out again. i was sold on the fact that the fingerprint sensor would stop that from happening but they can just reset the phone and have it as theirs new. is there anything i can do to get my phone back.

    If you set up your phone correctly, it is still protected by the Activation Lock and can be used without knowing your AppleID and password.
    Here are some more things about that:
    What if your iOS device is off or offline?
    If your missing device is off or offline, you can still put it in Lost Mode, lock it, or remotely erase it. The next time your device is online, these actions will take effect. If you remove the device from your account while it's offline, any pending actions for the device will be cancelled.
    How do you turn off or cancel Lost Mode?
    You can turn off Lost Mode by entering the passcode on your device. You can also turn off Lost Mode on iCloud.com or from the Find My iPhone app.
    copied from If your iPhone, iPad, or iPod touch is lost or stolen

  • Can i open winamp using java?

    hi frnds,
    i want to know how to open winamp using javacode.......
    Thank u.

    JDIC
    https://jdic.dev.java.net/
    "This incubator project hosts the API to control the native music players, e.g. Winamp, Rhytmbox, iTunes, etc."
    https://jdic.dev.java.net/incubator/mpcontrol/index.html

  • I got the iPhone 4S and I use google calendar and when the Sprint salesperson set up my phone only 2 months of my calendar went on my phone. How do I get my whole calendar to sync on my phone?

    I got the iPhone 4s and i use google calendar and when the Sprint sales person set up my phone, only 2 months showed up on my iPhone. How do I sync all of google calendar to my iPhone!

    Settings/Mail,Contacts,Calendar - there's a setting for how far back to sync calendars.

Maybe you are looking for

  • Rule Upload : GRC10

    Hello Gurus, Would appreciate if anyone can let me know how to use the Upload SOD rules feature under SPRO>Access Control> Access Risk Analysis> SOD Rules> Upload SOD rules. Here I am asked to upload the files for Business Process, Function, Permissi

  • As of today, Firefox windows no longer resizeable! OSX 10.6.8, Firefox 20.0

    As title suggests, the resize control on lower right corner of all Firefox windows is gone!

  • Advise on fsg report

    Hello financial gurus Our client is having trouble running the standard fag report because the number of columns they have is more than 100 and the standard report therefore fails. They have asked us to redo the report in discoverer. Is it possible t

  • Hi - we have 'lost' photos in the iphoto library

    Hi - we have 'lost' photos in the iphoto library & relevant albums & slideshows frm 2009-2012; they are shown as empty. Older photos (pre 2009) were backed up & are all there in the library, album and slideshows although jumbled up in the library - t

  • F.81 reverse postings error 00 065: Enter date in the format __.__.____

    Hi When we run F.81 in some cases we get the error: 00 065: Enter date in the format __.__.____ In the header from the document I don't see difference with the working one's How we can solve this?