View Single Post
 
Old 03-30-2015, 02:05 AM
NobodysPerfect NobodysPerfect is offline Windows 8 Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default Significant performance problem when duplicating or pasting shape

Hi to all,

I’d be glad if anyone could help me with some very slow cold.

Given: Shape (in front of text) in the first cell of a table. Shape properties:
Code:
With Shp
    .RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
    .RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
    .Height = CentimetersToPoints(2.63)
    .Top = CentimetersToPoints(1.66)
    .Left = CentimetersToPoints(2.57)
    .Name = “ShapeToInsert”
End With
Wanted: Copy/Paste or Duplicate/Move Shape into all cells of the table.

Problem: Whatever way I try as soon as the shape is pasted / duplicated, the properties .Left and .Top get lost. Which means, I need a second loop to adjust .Top and .Left again. Unfortunately the formatting takes about one second per shape.

Do you have any idea how to improve the code or do you even see another approach than mine?

Any help appreciated – as always
NP
Reply With Quote