none
Inline shapes RRS feed

  • Question

  • Hi

    How to copy all InlineShapes from existing word document and paste it in another existing word document(Template) . Each page should paste one inlineshapes.

    Friday, December 6, 2013 11:25 AM

Answers

  • Basically:

    Sub Demo()
    Dim wdDoc As Document, iShp As InlineShape
    With ActiveDocument
      Set wdDoc = Documents.Add
      For Each iShp In .InlineShapes
        iShp.Range.Copy
        wdDoc.Range.Characters.Last.Paste
        wdDoc.Range.InsertAfter Chr(12)
      Next
      wdDoc.Range.Characters.Last.Previous.Delete
    End With
    Set wdDoc = Nothing
    End Sub


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Friday, December 6, 2013 12:07 PM
  • Thanks Paul, Its woking fine.

    I need one more help. I want to read word document Line by Line.. using paragraph i tried but i am getting whole content but i need line by line.

    Help me

    • Marked as answer by MohdTaj Wednesday, December 11, 2013 1:23 PM
    Tuesday, December 10, 2013 5:36 AM

All replies

  • Basically:

    Sub Demo()
    Dim wdDoc As Document, iShp As InlineShape
    With ActiveDocument
      Set wdDoc = Documents.Add
      For Each iShp In .InlineShapes
        iShp.Range.Copy
        wdDoc.Range.Characters.Last.Paste
        wdDoc.Range.InsertAfter Chr(12)
      Next
      wdDoc.Range.Characters.Last.Previous.Delete
    End With
    Set wdDoc = Nothing
    End Sub


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Friday, December 6, 2013 12:07 PM
  • Thanks Paul, Its woking fine.

    I need one more help. I want to read word document Line by Line.. using paragraph i tried but i am getting whole content but i need line by line.

    Help me

    • Marked as answer by MohdTaj Wednesday, December 11, 2013 1:23 PM
    Tuesday, December 10, 2013 5:36 AM
  • Please start a new thread for that and mark my previous reply as the answer.

    Do note that Word's use of the attached printer driver means that what might be evaluated as a 'line' can vary from PC to PC just because of printer differences. The same applies even more so to pages.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, December 10, 2013 5:42 AM