none
Reading bold char in office 2003 word doc RRS feed

  • Question

  • Hi,

    I want to read no of bold char in MS word 2003 document.

    I can do the same for word 2007 doc with open xml apis.

    But using the same api for MSWord 2003/97 does not work.

    As per my understanding open xml standards were made word complaint starting 2007.

    Is there any other way of getting this done through open xml or in build word apis.

    Thanks in advance.

     


    Chandan Mahajan
    Thursday, February 10, 2011 11:58 AM

Answers

  • Hi Chandan,

    Thank you for posting and we are glad to help with you.

    >>But using the same api for MSWord 2003/97 does not work.

    I am not very familiar with Open XML sdk about reading bold char, so , could you show me some code snippet about reading bold char in Word2007?

    As far as I know, you can't read the word 2003/97 file using open XML. Open XML is a standard file format which is different from traditional binary format file. Open XML SDK provides various API to process Open XML format documents, but not word 2003/97 binary files. You should convert Word 2003/97 files to docx format.

    In addition, please take a look at this thread: http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/9e1cc463-0bbc-41db-bd08-743939c6ff03/

    >>Is there any other way of getting this done through open xml or in build word apis.

    I think you can use build-in APIs to make it. I studied from this article: http://msmvps.com/blogs/deborahk/archive/2009/08/31/bolding-text-in-microsoft-word-using-net.aspx , and learnt that you can foreach words or characters and judge whether it is bold via w.Font.Bold == 1 , I didn't test it on my computer, you can take a try.

    I hope this can help you and feel free to follow up after you have tried.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Bessie Zhao Friday, February 18, 2011 10:06 AM
    Monday, February 14, 2011 11:25 AM