PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED]Extracting all text-box text from Doc-VBForums
Results 1 to 3 of 3

Thread: [RESOLVED]Extracting all text-box text from Doc

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Resolved [RESOLVED]Extracting all text-box text from Doc

    Hi,

    Back again with another word-macro query. This time I'd like to be able to copy all the text out of the textboxes in a document and write them to another file, preferably with the page number of the text box appended.
    There doesn't seem to be any textbox property of Document, so I'm not sure what angle to approach this from.

    Cheers,
    P
    Last edited by pickarooney; Apr 27th, 2005 at 08:08 AM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Re: Extracting all text-box text from Doc

    Got the first bit done - I needed to use Shapes

    VB Code:
    1. Sub ExtractTextBoxes()
    2.  
    3. Dim s As Shape
    4. Dim mString As String
    5.  
    6. For Each s In ActiveDocument.Shapes
    7.     If s.TextFrame.HasText = True Then
    8.         mString = s.TextFrame.TextRange.Text
    9.     End If
    10. Next s
    11.  
    12. End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Re: [RESOLVED]Extracting all text-box text from Doc

    Just thought I'd update this with the working code to extract and replace textbox text, in case it's of use to anyone.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width