T
Tony Logan
I'm inserting PowerPoint slides into a Word document. Everything runs fine
until the total # of PowerPoint slides is 100 or more (I know what you're
asking...who's going to sit through a 100-slide PowerPoint presentation? This
question haunts me, too.).
With 100+ slides, the order of slide insertion goes correctly from slides 1
through 10. But then things go haywire. Slides 100-109 get inserted next,
then we go back to 11 and continue from there.
Here's the code. I'm not sure what's wrong with the logic:
Dim pics As Integer
Dim JPGFolder As Folder
Dim JPGFile As File
pics = 0
For Each JPGFile In JPGFolder.Files
pics = pics + 1 ' count pics; use this info later in routine
Selection.InlineShapes.AddPicture FileName:=(JPGFile)
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.Collapse Direction:=wdCollapseEnd
Next JPGFile
until the total # of PowerPoint slides is 100 or more (I know what you're
asking...who's going to sit through a 100-slide PowerPoint presentation? This
question haunts me, too.).
With 100+ slides, the order of slide insertion goes correctly from slides 1
through 10. But then things go haywire. Slides 100-109 get inserted next,
then we go back to 11 and continue from there.
Here's the code. I'm not sure what's wrong with the logic:
Dim pics As Integer
Dim JPGFolder As Folder
Dim JPGFile As File
pics = 0
For Each JPGFile In JPGFolder.Files
pics = pics + 1 ' count pics; use this info later in routine
Selection.InlineShapes.AddPicture FileName:=(JPGFile)
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.Collapse Direction:=wdCollapseEnd
Next JPGFile