Read MS Word properties

Hi every body,
i need to read the properties of any MS-WORD document. Author, number of pages, number of words, etc. I really don't have any idea on where to begin.
Can somebody help me? Giving me a hint.
Waiting your response.
Thanks

Yes, it's quite complicated but doable using http://danadler.com/jacob. Search for examples in the JACOB mailing list hosted at yahoo groups. Here is a snippet:/*
* For MS Word Built-in Properties, see:
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaof10/html/ofobjDocumentProperty.asp
        //Getting the doc's properties
     Object buildtInProperties = Dispatch.get(aDoc, "BuiltInDocumentProperties").toDispatch();
     // Get Title attribute (#1)
     Object aTitle = Dispatch.invoke(buildtInProperties, "Item", Dispatch.Get, new Object[] {new Integer(1)}, new int[1]).toDispatch();
     String strTitle = Dispatch.get(aTitle,"Value"));
        String newTitle = "New Title";
     Dispatch.put(aTitle, "Value", newTitle);
     // Get Subject attribute (#2)
     Object aSubject = Dispatch.invoke(buildtInProperties, "Item", Dispatch.Get, new Object[] {new Integer(2)}, new int[2]).toDispatch();
     System.out.println("Subject: " + Dispatch.get(aSubject,"Value"));

Similar Messages

  • Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD

    Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD
    I configured the user profile service application and run Sync and user profiles and its properties returned from Active directory but when I want to read it pragmatically it returns null values.
    this is my code...
       void runQueryButton_Click(object sender, EventArgs e)
               // Get the My Sites site collection, ensuring proper disposal
                using (SPSite mySitesCollection = new SPSite("http://sp/my"))
                    //Get the user profile manager
                    SPServiceContext context = SPServiceContext.GetContext(mySitesCollection);
                    UserProfileManager profileManager = new UserProfileManager(context);
                    UserProfile profile = profileManager.GetUserProfile("Contoso\\user");
                    foreach (Property prop in profileManager.Properties)
                       // if (prop.Name == "Department")
                        resultsLabel.Text += prop.DisplayName + ":" + profile[prop.Name].Value + "<br />"; ;

     Hi,
    Please try with the following code
          PrincipalContext principalContext = new PrincipalContext(ContextType.Domain);
                                SPServiceContext context = SPServiceContext.GetContext(site);
                                UserProfileManager profileManager = new UserProfileManager(context);                        
      foreach (Property prop in profileManager.Properties)
                       // if (prop.Name == "Department")
                        resultsLabel.Text += prop.DisplayName
    + ":" + profile[prop.Name].Value + "<br />"; ;
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • Read one word at a time from a text file

    I want to read one word at a time from a text file as it is done by "scanf &s" function in text based programme. It is not possible by " read from text"  function. Suggest me  function or method to solve this.

    The simplest way is to use the spreadsheet string to array function with the space character as the delimiter.
    Note that this won't work unless there is a space character between the words - it won't work with line feeds / carriage returns between the words but you could always split the string into lines first. You may also want to trim whitespace to remove any other non-visible characters (e.g. tab, line feeds) from around the word.
    If you need something more sophisticated that splits based on whitespace (e.g. tab, new line) then you'll probably need to do something with searching the string for these characters (e.g. using a regular expression) and then splitting them yourself into an array.
    Of course...if you actually want to just read one word at a time from the file rather than just split the file into words (I assumed you meant this), you will need to read the file byte by byte using the low level file IO functions, build a buffer of the bytes and check the character you've read to see if it a space.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Just updated to Lion.  Didn't realize things like reading a Word document would not be supported.  How do I get these files back and how I do read them going forward?  When a PC user sends me a word document won't I be able to open it and read it?

    Just updated to Lion today, 11/22/11.  I did not realize things likes reading a Word document would not be supported.  "You cannot open this because PowerPC applications are no longer supported."  How am I supposed to read and open Word documents from PC users?  Any insight is helpful, thanks!

    You have Word 2004 which is PPC based. Lion is not able to execute PPC code. You have to upgrade. Or you can do as I do an open them in Pages, since I refuse to allow anything from Microsloth on my Mac.
    Allan

  • Issue in reading multiple time properties file

    Use Case:
    I have a page in which i have to show some Outage Messages on page. So I have configured outage message in properties files. This message should me rendered each time when it finds that properties file in class path or it finds the values w.r.t their keys.
    So what I decide that I shall write java method and call this method on Loading the page but here what happen is that whenever that page is load each time that reader file will call , that will create memory leak .
    So, anyone help me on this. What will be the best approach for that reading multiple times properties file?
    I will be grateful for any help you can provide
    Thanks

    Hi,
    have a bean at applicationScope, somewhat like this
    import java.util.HashMap;
    public class ApplnProperties {
        private HashMap _propMap;
        public HashMap getPropMap() {
            if(_propMap == null){
                //read the properties file and populate _propMap
            return _propMap;
    }here we put condition _propMap == null so it would be called only once during application lifecycle.
    and on page you can refer the prop map like following
    #{beanName.propMap['KEY1']}Regards,

  • How to read from a .properties file...?

    Hello all,
    I'm new to this forum.
    I have a problem in reading data from .properties file...
    Follow is my properties file...
    log4j.properties
    log4j.rootLogger=warn, file, mail
    log4j.appender.file=org.apache.log4j.RollingFileAppender
    log4j.appender.file.maxFileSize=100KB
    log4j.appender.file.maxBackupIndex=5
    log4j.appender.file.File=D:\log.txt
    log4j.appender.file.threshold=info
    log4j.appender.file.layout=org.apache.log4j.PatternLayout
    log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    #email appender
    log4j.appender.mail=org.apache.log4j.net.SMTPAppender
    #defines how othen emails are send
    log4j.appender.mail.BufferSize=1
    log4j.appender.mail.SMTPHost="smtp.Honeywell.com"
    log4j.appender.mail.From=[email protected]
    log4j.appender.mail.To=[email protected]
    log4j.appender.mail.Subject=Log ...
    log4j.appender.mail.threshold=error
    log4j.appender.mail.layout=org.apache.log4j.PatternLayout
    log4j.appender.mail.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    I want to access file path given in .properties file..
    I'm coding like this...
    Properties props = new Properties();
    String p=props.getProperty("file.FILE");
    The above code is not getting me the string.. it shows null value...
    Any solution...?
    Thanks in advance......

    RahulSharna wrote:
    public Properties getProperties(String fileName)throws Exception{
    Properties prop = null;
    FileInputStream fis = null;
    Exception e = null;
    File file = new File(fileName);
    if(!file.exists())
    new FileNotFoundException(fileName);
    try{
    prop = new Properties();
    fis = new FileInputStream(file);
    prop.load(fis);
    }catch(Exception exp){
    e = exp;
    }finally{
    if(fis != null){try{fis.close();}catch(Exception ep){}}
    fis = null;
    file = null;
    if(e != null)
    throw e;
    return prop;
    }Hope the above snippet helps :)
    REGARDS,
    RaHuLYou do know that you can throw out of the catch block without "short-circuiting" the finally block, right? Making the declaration of e completely foolish. (Unless you actually want to do something after the try/catch block, of course.) And, if all you're going to do is throw the exception anyway, why bother catching it?

  • How do I convert a read only word doc to a read only pdf file?

    How do I convert a read only word doc to a read only pdf file?
    Thanks, Linda

    Hi Linda,
    I just tried it, and was able to convert a Word .doc to to PDF, in spite of the fact that it was marked Read Only. Here are the instructions for uploading and converting to PDF with Acrobat.com:
    http://help.adobe.com/en_US/Acrobat.com/Acrobat/WS396AAA88-4AA4-4a40-87B8-004A5DC1E131.htm l
    Kind Regards,
    Michelle

  • Read Windows System properties

    Hi ,
    i want to read the some properties in windows 2000 from java,
    If u go to
    control panel - System - hardware - Device manager - port - COM1 then right click on it and see the properties, and click the Port Settings.
    I want to read the bits per second from there.
    Ashish

    It's actually more than twice. Maybe somebody sneaked in and used your computer when you weren't watching. But in reference to the about 6 times you have asked this question, here's how it seems to work around here. If you don't get an answer, then either your question is too unclear to understand or there is no answer. Your question is perfectly clear. So the conclusion should be obvious.

  • Read a word embedded in xml tag

    Hi everyone...
    i am an university student. i am doing a final year project.....dealing with program
    i want to ask how to read a word embedded in xml tag...
    that is e.g apple
    xml file: <fruit> apple </fruit>
    <price>$4.00</price>
    how to read apple from xml file and using a variable to store the word using java?
    pls help.....

    If you want to parse XML (more than the simple example you give), I recommend you go here: http://xml.apache.org and download Xerces for Java.
    If you want to parse the text yourself, look at:
    java.lang.String methods: indexOf(String,int) and substring(int,int)
    java.util.StringTokenizer

  • SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT - Active Directory Security Group Discovery Agent reported warnings for 524 object(s). DDRs were generated for 0 object(s) that had warning(s) while reading non-critical properties.

    Hi, can anyone help me troubleshoot the following please:
    Active Directory Security Group Discovery Agent reported warnings for 524 object(s). DDRs were generated for 0 object(s) that had warning(s) while reading non-critical properties. DDRs were not generated for 524 object(s) that had warnings while reading
    critical properties.
    Possible cause: OU name or Security Group name may contain at least a Unicode character which has conversion problem between Unicode and your system ANSI locale(e.g. Korean characters in English System Locale). The site server might not have access to
    some properties of this object. The container specified might not have the properties available.
    Solution: Please verify the Active Directory schema for properties that are not replicated or locked. Refer to the discovery logs for more information.
    Does the error relate to 524 security groups? There are several invalid search paths listed in adsgdis.log, are these related?
    Thanks,
    Dale

    You'll have to examine the log to determine exactly which objects its referring to. Although this is in the context of group discovery, group discovery still creates DDRs for computer objects within those groups so it could be either groups or computers.
    This is not a search path issue though as it's clear that the discovery process found 524 different objects, but as stated, it could not properly read criticial properties of those objects and thus did not create DDRs for them.
    As mentioned, reading the log in detail will list the objects individually and the reason it could not create a DDR for it.
    Jason | http://blog.configmgrftw.com

  • How to read MS Word file

    Hi,
    How can i read MS word file in java ? My problem is that want to read .doc file and convert this .doc file into .txt tile . I was try with Jakarata POI , but i m not found out POI ?
    How to use Jakarata POI for reading .doc file ?
    Thanks in advance
    madhu
    [email protected]

    I believe your looking for the <input type="file" tag to read a file from the user's browser to the servlet. There are examples of this on line. POI is used after the file is read into the servlet to extract its information.

  • Poor quality convertion from adobe reader to word

    Good day,
    I received a poor quality convertion from adobe reader to word.
    Can I send the original to anybody for help or a better convertion.
    Enjoy your day
    Regards
    Johan de Beer

    Without context, my guess is that your question should go in the ExportPDF forum,
    http://forums.adobe.com/community/exportpdf

  • All of a sudden my 3 year old macbook pro screen is blurred - I can hardly read the words - any ideas?

    All of a sudden the screen on my 3+ year old macbook pro has blurred badly - I can hardly read the words - any ideas?

    You likely didn't erase the ENTIRE drive of the later OS X operating system before installing Snow Leopard. You just targeted the Macintosh HD partition.
    Try again, this time make sure to select the name and size of your boot drive at the top to catch the hidden EFI partition that's responsible for the splash screen at boot time (no screen = white)
    It will take two reboots to reset the EFI again, so once Snow is installed and reboots, reboot again.
    How to erase and install Snow Leopard 10.6
    How to revert your Mac to Snow Leopard
    Restoring firmware on Intel Mac's

  • Hello! how can i put and read my words documents in the notes pad of my ipod nano 3trd generation?thanks to all.the notes

    hello! how can i put and read my words documents in the notes pad of my ipod nano 3trd generation?thanks to all.

    The Notes features of the 3G iPod Nano only supports TXT files and not Word Documents.  If you want to be able to read these word documents, you'll need to copy the text from each over to a text file.  See here for more information.
    iPod: Storing and reading notes
    Keep in mind that each txt file has a limit of 4096 characters.  See this article for more information as well.
    Long notes are truncated on your iPod
    B-rock

Maybe you are looking for

  • Availability of "italian" language culture option

    Hi to all, we have many requests from our clients to have all system messages customized in italian language, but there is a set of them that depend on the "culture" setting. At this moment, the ITALIAN language in the culture settings is not yet ava

  • Ethernet issue Windows 8.1 Boot Camp

    Installed Windows 8.1 on boot camp - Macbook pro mid 2010. Everything workes very well except for - Ethernet works at first, but then stops working completely and I cannot get it to work again until I reboot. Happens every time, and no alert in Windo

  • Reconstructing a RAID with TM

    I posted this elsewhere with o joy ... I had a software RAID on 2 WD 1Tb drives, but one of them kept un-mounting, and despite repairing permissions and re-formatting it has had to be replaced. Now what I have is one TM vol and another mounted vol. E

  • Both OS X 10.9 and OS X 10.8

    I just bought an iMAC and I currently have OS X 10.9 Maveriks. Question: By using Disk Utility, can I create a second partion on my disk drive and install a new version of OS X 10.8 Mountain Lion, so I can have and use both of the Operating System, 1

  • InterMedia in Jdeveloper?

    How can i use interMedia possibilities in Jdeveloper. I want to get an image, audio, video from a oracle8i database. null