![]() |
#1
|
|||
|
|||
![]()
Bonjour
Je maitrise mal votre langue, et je m'en excuse. Le texte qui suit est issu d'une traduction automatique, et il peut ne pas être clair. I use Word VBA to insert numerous shape objects in documents. Under Word 2003, the macro run in a immediate way. But under Word 2010, these macros are in practice unusable because their execution can be very slow. Here is an example: Code:
Sub MesureDuree() Dim i As Long, Boite As Shape, Debut As Date Debut = Time For i = 1 To 100 'Set Boite = Me.Shapes.AddTextbox(msoTextOrientationHorizontal, 4 * i, 72.75, 4, 19.5) Set Boite = Me.Shapes.AddShape(msoShapeRectangle, 4 * i, 72.75, 4, 19.5) Boite.Fill.ForeColor.RGB = RGB(2 * i, 2 * i, 2 * i) Next i MsgBox CStr((Time - Debut) * 24 * 3600) & " s" End Sub If I register(record) the new document in the size(format) Word 2003 (extension .doc, i.e. in mode(fashion) of compatibility) before throwing(launching) the macro, the execution is immediate. For the version with Textbox, the run time in Word 2010 achieves 50 seconds! What changed between both versions of Word to have such a slowing down, and can one avoid him while leaving the document with the format 2010? J'utilise Word VBA pour insérer de nombreux objets shape dans des documents. Sous Word 2003, les macros s'exécutent de façon instantanée. Mais sous Word 2010, ces macros sont en pratique inutilisables car leur exécution peut être très lente. Voici un exemple : .... J'ouvre un nouveau document sous Word 2010 et je colle la macro dans ThisDocument. L'exécution dure 6 secondes. Si j'enregistre le nouveau document au format Word 2003 (extension .doc, c.-à-d. en mode de compatibilité) avant de lancer la macro, l'exécution est immédiate. Pour la version avec Textbox, le temps d'exécution en Word 2010 atteint 50 secondes ! Qu'est ce qui a changé entre les deux versions de Word pour avoir un tel ralentissement, et peut on l'éviter tout en laissant le document au format 2010 ? |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
mhagi | Word VBA | 2 | 10-16-2015 12:21 AM |
![]() |
User12344321 | Word | 4 | 09-21-2015 12:54 PM |
All Shapes on slide | excelledsoftware | PowerPoint | 9 | 09-15-2013 04:03 AM |
![]() |
SueK | PowerPoint | 1 | 01-20-2011 04:30 AM |
My Shapes some appear some don't | Jean-Paul | Visio | 0 | 03-01-2006 01:38 AM |