How to check if there is specific text in a word document ?

Hello everyone ,
I have a form include text box1  , I need to check a word document if  there is specific text inside it , if it’s true the textbox1.text = 1 , if it’s false the textbox1.text = 0 , and so on .
to be clear I’m trying to check a lot of things not just specific text also ( font size , font color , font type , photo , table …………etc ) .
I read a lot of threads about Office Automation , all about how to create a new documents and insert text tables photos….. etc, but what I need just to check if it existing or not
Any idea , books, threads ,examples ….
Thanks in advance.
Visual Studio 2013
office 2007

"1- what if i need to check that word in the beginning of the second paragraph in that document or at the end of the third paragraph "
to find a word in a paragraph, use the range keyword as in
Dim rng As word.Range = objDoc.Paragraphs(1).Range
rng.Find.Execute(FindText:="yourtext")
" can you give me any website or books , to learn how to check  ( font size , font color , font type , photo , table
…………etc ) and return with (1,0) or (true ,flase)."
You can use the range object here aswell
If rng.Font.Size = 7 Then TextBox1.Text = 1
Look at this link for a multiple of examples about word automation
https://msdn.microsoft.com/en-us/library/78whx7s6(v=vs.80).aspx

Similar Messages

  • How do I find and remove specific text in a PDF document?

    hi. sorry for my english (i am from russia))
    there is the problem - how do i find specific text in a document (in my case, it - all numbers (0-9)) and delete it, using javascript??
    And I would like to know also - is the a search function with regular expressions??
    And most importantly - how to remove the founded text???
    is it possible?
    document is so big, that if I manually delete the numbers - I will do it for a month!!))
    Thank you!!!!

    Thanx!!!
    that is, if there are entries in document "hello 1234", then the search all words will identify it as two words "hello" and "1234". and then I check with regular expressions where the numbers.. ?
    ps. and I have not found yet any command, that replace the founded text from javascript))
    yes.. in acrobat X pro.. tools-protection-search&remove is also avaible....! (but, no regular in search string.. to bad...)
    thank you!

  • How to check if there is a layout open for a document?

    I want to check whether the document I have is hidden in In-design or there is a layout window open for it.
    Is there a API to check this?
    I looked into IDocumentPresentation but did not found any helpful API. Can some one suggest?

    you can try: if doc is opened then active it
    PMString strActiveDocumentName("ExampDoc");
      // Get opening document list
      InterfacePtr<IDocumentList> oDocumentList(oApplication->QueryDocumentList());
      if (oDocumentList)
      for(int32 i = 0; i < oDocumentList->GetDocCount() ; i++ )
      // Check document name
      IDocument* oDocument = oDocumentList->GetNthDoc(i);
      PMString strDocName;
      oDocument->GetName(strDocName);
      if(strActiveDocumentName == strDocName)
      // Get DocumentUIDRef
      UIDRef oDocumentUIDRef(nil, kInvalidUID);
      IDataBase* oDatabase = ::GetDataBase(oDocument);
      if (oDatabase == nil)
                                break;
      UID oDocumentUID = oDatabase->GetRootUID();
      if (oDocumentUID == kInvalidUID)
                                break;
      oDocumentUIDRef = UIDRef(oDatabase, oDocumentUID);
      // Make active document
      InterfacePtr<IPresentationList> oPresentationList(oDocumentUIDRef, UseDefaultIID());
      if( oPresentationList)
      for(int32 j = 0, iMax =  oPresentationList->size(); j < iMax; j++)
      IDocumentPresentation* oDocumentPresentation =  oPresentationList->At(j);
      oDocumentPresentation->MakeActive();
      return true;

  • How to check whether there r new txt files in a folder n file creation date

    How to check whether there r new text files in a specified folder and what is the date of creation of the text file.........?

    Hi
    I have been searching for a solution to find the date of creation of a file for over 6 months now but haven't found it. So I presume that it is not possible though I havent found any authentication of my assumption in any document.
    Cheers!
    Shailesh

  • How to check File size of a Text file.

    How to check File size of a Text file.
    please explain me.
    I am new in LabVIEW. and dont have much idea on this...;
    Prashant Soni
    LabVIEW Engineer
    Solved!
    Go to Solution.

    Hi Prashant,
    and here's what you get when using the LV help...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to check if there is any problem in the interaction center inbox

    hi,
    how to check if there is any problem in the interaction inbox for recieving the attachments/cic0
    some users who are sending withattachments is not able to reach the sap indox./
    but without the attachments the mails are coming
    I want to know how we can able to find out were is the problem.
    thanks in advance
    Prajith P

    hi,
    Any update for the above query.
    Thanks & Regards
    Prajth P

  • How to check Reconcilliation has happened or not for a payment document

    Hi,
    How to check Reconcilliation has happened or not for a payment document? Payment doc ABCDEF was created on 2nd. Now i am not sure whethr RECON has happend ot not
    Please help.

    Dear,
    If you have made payment to vendor and want to know whether reconciliation happened or not then check if this document exist in table BSIK then reconciliation has not been done.
    Regards,
    Chintan Joshi.

  • Standard text in Routings - Word documents

    Hi all
    I want to attach word documents to Standard Routers. I checked the standard text CA10 but did not find a way to upload word documents. I saw an option only for uploading 'ASCII', RTF or RTF files. Is there a way I can attach word documents to the Routings. What is the best way to do it? Is it standard text or some other process.
    Am using ECC 6.0
    thanks

    Dear,
    you cannot attach,....but you can copy from word document to text click on long text and copy the word document data to the long text page and save

  • Help! I've deleted most text in a Word document and pressed save!

    Help! I've deleted most text in a Word document accidentally and pressed save - thus losing most of the last week's work! Is there likely to be a temp file anywhere from yesterday so that I can retrieve it?

    I don't know which Mac you have, but if you have an intel, update to 10.7 and you can use the function called Versions, which autmatically saves a version of your text, and you can revert to it when needed.

  • Automatically copy only the unicode-Text from a Word-Document into FM8

    In my daily work I often have the problem to copy and paste text from a  Word-Document or other documents into my FrameMaker documents.
    The common way is to copy it in Word and "Special Paste" it in FrameMaker 8 as unicode. But this is not as confortable as to shortly hit Ctrl-v on the keyboard.
    I would like to have a new menuitem to special paste only the unicode text from the clipbopard. Is there a way to make such a makro and to put it in the menubar with a Key-Trigger?
    I read something like that in http://www.rzg.mpg.de/from_external/Frame6_Handbuch/Setting_up_FrameMaker.pdf (german), but I actually don't know what to chage for my case.

    Rather than create a new menu item (possible, I gather, but fiddly) I would recommendchanging the default “paste” behaviour.
    In the MAKER.INI file there is a line beginning
    ClipboardFormatsPriorities=
    Change this to put UNICODE TEXT as the first item.
    Ctrl-v will then paste Unicode text by default. You can still access the other options, should you need to, by using Paste Special.

  • Is there a way of locking a word document in ios mountain lion so that it cant be printed or changed?

    Is there a way of locking a word document in mountain lion so it cant be printed or changed?

    You can print because it's your document. Others shouldn't be able to. But then it's easy enough to unlock them altogether.
    Easiest is to get encryption software and just encrypt the document. Or create a small encrypted disc image with Disk Utility and store the document in the disc image.

  • How do I maintain my hyperlinks when converting a Microsoft Word Document to a PDF file?

    How do I maintain my hyperlinks when converting a Microsoft Word document to a PDF file?

    Hi Marbarrose,
    When you make word file including hyperlinks then convert in pdf.
    It will automatically maintain hyperlinks.
    Regards,
    Florence

  • How to check the content in a text file line

    hi all,
    i had the following problem:
    There is a text file with multiple lines of data in it
    The data comprises of characters, numbers and symbols
    In this file, any line can be commented (till the end) by using symbol ';'(semi-colon)
    Now i have to find the number of occurences of a symbol '$' in this data, such that
    it should not exist in a commented line
    One more limitation is that ';' (semi-colon) could occur at any position in a line, i.e., if this occured in the middle of the line, then all the following data in the line is taken to be as commented one and we have to skip it and move to next line.
    Plz do help.
    Regards,
    santosh
    Regards,
    santosh

    Hi santosh,
    just a guess this is what you need.
    Greets, Dave
    Message Edited by daveTW on 09-15-2006 09:59 AM
    Greets, Dave
    Attachments:
    search & count $.vi ‏13 KB
    search & count $.png ‏10 KB

  • How to Search for text in a word document and replace it

    Hey All ,
    I am able to open up a word document present locally using OLE2 Automation. Now i need to search for a text in that document
    and replace it with another text. How do i achieve this?
    And another issue is when i search for the particular pattern i need to store the pattern that comes after the pattern as i need it for further use before i replace it.
    Thanks And Warm Regards,
    Nischal

    Hey Chen,
    Well before i do the search and edit , I am actually opening a .mts file in word which is happening successfully.
    The issue that i am facing now is I am unable to save it as .doc file through the 'SaveAs' method.
    Here is my code. Can u please tell me what i need to do in order to correct this.
    After i do this conversion i intend to pass the data from the .doc file to an internal table and then do the required change.
    But First i need to save it to .doc type.
    REPORT  MAIN_PROGRAM_2.
    INCLUDE OLE2INCL.
    *Declaration Of OLE2_Object Variables.
    DATA: WORD            TYPE OLE2_OBJECT,
          DOCUMENTS       TYPE OLE2_OBJECT,
          ACT_DOCUMENTS   TYPE OLE2_OBJECT.
    *Declaration of variables
    PARAMETERS PATH       TYPE string.
    DATA:Relative_Path    TYPE string,
         Relative_Path_Save    TYPE string.
    *Declaration of an internal table
    CONCATENATE PATH '\Script.mts' INTO RELATIVE_PATH.
    *Object Creation in order for us to open word
    CREATE OBJECT WORD 'WORD.APPLICATION'.
    PERFORM ERROR_HANDLE.
    *Set visibility property of MS word.
    SET property of WORD 'VISIBLE' = 1.
    *Open A document
    CALL METHOD OF WORD 'Documents' = DOCUMENTS.
    PERFORM ERROR_HANDLE.
    *CALL METHOD OF DOCUMENTS 'ADD' = ACT_DOCUMENTS.
    CALL METHOD OF DOCUMENTS 'OPEN' EXPORTING #1 = RELATIVE_PATH.
    PERFORM ERROR_HANDLE.
    *GET PROPERTY OF WORD 'ActiveDocument' = ACT_DOCUMENTS.
    *PERFORM ERROR_HANDLE.
    **To save the script.mts to script .doc file in order to put it into an internal table
    CONCATENATE PATH '\Script.doc' INTO RELATIVE_PATH_SAVE.
    CALL METHOD OF WORD 'SaveAs' EXPORTING #1 = RELATIVE_PATH_SAVE.
    PERFORM ERROR_HANDLE.
    FREE OBJECT WORD.
    The Save part of the code is giving me an OLE error = 2
    Thanks And Kind Regards,
    Nischal
    Edited by: Nischal HP on Apr 28, 2011 1:53 PM

  • How do I bookmark to a specific page in a another document

    How do I bookmark to a specific page in another document

    When you add a bookmark, it defaults to the current page and view (zoom, scroll). If you want it to link to a location in a different document, after you create the bookmark, select it, right-click, and select Properties and then select the Actions tab. Delete the default action and add a new one of the type "Go to a page view". When you're prompted with the "Create Go to View" dialog, open the other document and go to the page and set the view (zoom, scroll) that you want, and then click the "Set Link" button. When distributing the files, make sure they retain the same folder structure. This is easiest done if all of the PDFs are in the same folder.

Maybe you are looking for