Welcome to FreeSoftwareServers Confluence Wiki

VBA:

Public Sub TestMsg_IR(control As IRibbonControl)
 Call TestMsg
End Sub
Public Sub TestMsg()
 MsgBox "Hello World"
End Sub
Public Sub SaveAddIn()
 Dim FileNameStr As String ' , FileFormat As Integer, EmbedFonts As Integer
 FileNameStr = "C:\Users\UNAME\AppData\Roaming\Microsoft\AddIns\Updated-PowerPointAddIn.ppam.ppa"
 If FileExists(FileNameStr) Then
  DeleteFile (FileNameStr)
 End If
 Application.ActivePresentation.SaveAs FileNameStr, ppSaveAsAddIn, msoFalse
 Application.ActivePresentation.Save
End Sub
Public Function FileExists(ByVal FileToTest As String) As Boolean
   FileExists = (Dir(FileToTest) <> "")
End Function
Public Sub DeleteFile(ByVal FileToDelete As String)
   If FileExists(FileToDelete) Then
      On Error Resume Next
      SetAttr FileToDelete, vbNormal
      Kill FileToDelete
      On Error GoTo 0
   End If
End Sub



Batch:

@ECHO OFF
CLS
setlocal ENABLEEXTENSIONS
::FreeSoftwareServers.com

:: Kill PP
tskill POWERPNT

::AutoLoad Add-In
call ...\load_pp_addin.cmd"

set ppdir=%APPDATA%\Microsoft\AddIns

:: Remove Old File
del "%ppdir%\PowerPointAddIn.ppam.ppa" /s /f /q

:: Change FileName
copy "%ppdir%\Updated-PowerPointAddIn.ppam.ppa" "%ppdir%\PowerPointAddIn.ppam.ppa"
del "%ppdir%\Updated-PowerPointAddIn.ppam.ppa" /s /f /q

:: Copy to W Drive Folder
copy "%ppdir%\PowerPointAddIn.ppam.ppa" "W:\IT - Information Technology\Office Add-Ins\PowerPoint\Macros\"

ECHO "Note: CustomUI Elements must be Copied Manually to AddIn"
::PAUSE
  • No labels