Sorry, I lost track of the thread until MSFT reminded me the question remains unanswered. Forgive a newbie's negligence.
In answer to your question Steve, it is a blank presentation. I can start with a blank presentation, add the forms, vba code, class modules, references, XML, and all the stuff that makes this powerpoint pptm file an "application" - it's all primed and ready
to go. I can enable macros, and save it as a ppam file. And I can load it without errors, and even run it.
And while it is an Add-in, since at that point it is never getting messed with or saved, it does fine to run its features, add shapes to presentations, save and close those presentations.
But when modifying the original pptm , if I run the macros to copy images from the forms library to the presentation, I can't save the project as an addin - even if I strip it bare of any objects thereafter. This is an example of the routine that copies
images
Sub CopyImage(whichImage As String, Optional iLeft As Double, Optional iTop As Double)
Dim frmX As frmFlags, desiredHeight As Double, desiredWidth As Double
Dim objImage As Object, objGIF As Object
Dim LineInterrupted As Integer
On Error GoTo CatchCopyFlagError
DoEvents: DoEvents
If IsMissing(iLeft) Then iLeft = 40
If IsMissing(iTop) Then iTop = 30
Set frmX = New frmFlags
Load frmX
With frmX.Controls(whichImage)
Set objImage = ActivePresentation.Slides(ActiveWindow.View.Slide.Name).Shapes.AddOLEObject(Left:=10, Top:=10, Width:=.Width, Height:=.Height, ClassName:="Forms.Image.1", Link:=msoFalse)
objImage.OLEFormat.Object.Picture = .Picture
End With
With objImage
'MsgBox "Height: " & .Height & ", Width: " & .Width, vbOKOnly
desiredWidth = 20
desiredHeight = 20 * .Height / .Width
.OLEFormat.Object.AutoSize = True
.LockAspectRatio = False
If Application.Version >= 15 Then 'modified for Global Desktop 1.5
.OLEFormat.Object.PictureSizeMode = fmPictureSizeModeStretch
Else
.OLEFormat.Object.PictureSizeMode = fmPictureSizeModeZoom
End If
End With
objImage.Copy
LineInterrupted = 100
If Application.Version >= 15 Then 'modified for Global Desktop 1.5
'ActiveWindow.View.PasteSpecial
ActiveWindow.View.PasteSpecial datatype:=ppPasteEnhancedMetafile
Else
ActiveWindow.View.PasteSpecial datatype:=ppPasteGIF
End If
LineInterrupted = 10
objImage.Delete
LineInterrupted = 2
Set objGIF = Application.ActiveWindow.View.Slide.Shapes(Application.ActiveWindow.View.Slide.Shapes.Count)
If Application.Version >= 15 Then 'modified for Global Desktop 1.5
With objGIF
.Top = iTop - 9
.Left = iLeft - 1
.Height = desiredHeight
.Width = desiredWidth
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(192, 192, 192)
.Line.Weight = 2 '0.5
End With
Else
With objGIF
.Top = iTop - 9
.Left = iLeft - 1
.Height = desiredHeight
.Width = desiredWidth
LineInterrupted = 3
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(192, 192, 192)
.Line.Weight = 2 '0.5
End With
End If
Unload frmX
Set frmX = Nothing
Exit Sub
CatchCopyFlagError:
MsgBox Err & ":(" & LineInterrupted & ") " & Error, vbOKOnly
End Sub