Forum


Replies: 9   Views: 3357
Remove text
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by peterisi  · 28-07-2015 - 13:04

Is any method to remove all text from beginning docx document to the specify word?

Posted by admin  · 28-07-2015 - 13:33

Hello, There's no method to specifically do that, but using one of these methods: http://www.phpdocx.com/api-documentation/templates/delete-Word-template-block-content http://www.phpdocx.com/api-documentation/docxutilities/search-keyword-and-remove-paragraph-Word-document You can get a similar approach. Regards.

Posted by peterisi  · 29-07-2015 - 09:30

i saw it, but it doesn't helps me. How can I do it with this method? Any example?

Posted by admin  · 29-07-2015 - 09:44

Hello, What version and license of phpdocx are you using? Regards.

Posted by peterisi  · 29-07-2015 - 10:32

I want buy Corporate version for our company, but must sure that this problem will be solved in this version. Now we have trial.

Posted by admin  · 29-07-2015 - 12:09

Hello, Sorry but there's no example available for the trial version to do what you need. Using the searchAndReplace method available in the Corporate and Enterprise licenses along with the deleteTemplateBlock method you could: 1. Add a placeholder at the beginning of the document. 2. Replace the specific word by a new placeholder using searchAndReplace. 3. The new placeholder allows phpdocx to remove all text and content from the first placeholder to the second plaholder using the deleteTemplateBlock method. Regards.

Posted by peterisi  · 29-07-2015 - 12:34

OK one more question: Can I add placeholder on the beginning of the document by the phpdocx in Corporate version?

Posted by admin  · 29-07-2015 - 13:13

Hello, If you're creating a document from scratch you just need to add it into the document at the beginning. If you're using templates, or you need it with new documents instead of adding the placeholder, we'll send you a chunk of code to do that with any DOCX. Regards.

Posted by peterisi  · 29-07-2015 - 15:52

We just bought Corporate version can you explain how we can do it?

Posted by admin  · 29-07-2015 - 17:13

Hello, We're doing a sample script to explain how to do it. You'll receive it by email. Regards.