Consulting

Results 1 to 1 of 1

Thread: Cut data from Textframe MS word 2013 vba

  1. #1

    Arrow Cut data from Textframe MS word 2013 vba

    Hi there, i m working in word vba (office 2013), i want to cut data from inside textframe or textbox to paste outside the textframe
    i used following code to do such operation, but it works on new files, where i cut paste textframes from old files or saved files,
    and do not work on real file where textframes are naturally placed by user, i cant understand where is problem and what is diffrence between these files and how to solve

    please help me find the problem that why does it not work on real file where textframes are places along with other text, yes real files are unicode arabic

    it shows error
    run time error 5917
    the object does not support attached text









    Sub fromtxtbox()
    
    
    For Each s In ActiveDocument.Shapes
     Selection.Collapse WdCollapseDirection.wdCollapseEnd
    
    
    s.TextFrame.TextRange.Cut
        Selection.PasteAndFormat (wdFormatOriginalFormatting)
        
      
    Next
    end sub


    this run fine on some files and not on some files also


    yes i want to place cut data accurate on same place where textframe is placed and want to delete empty textframes after cut past operation, plz also help with these codings
    Last edited by sindhu2352; 03-03-2017 at 05:00 AM. Reason: adding error message

Tags for this Thread

Posting Permissions

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