Sha256: 1225ad01295a4bb4fe1a6888901209a7b43355a7e859ece406e431c7338337b2

Contents?: true

Size: 726 Bytes

Versions: 2

Compression:

Stored size: 726 Bytes

Contents

module Asposeslidesjava
  module RemoveVBAMacro
    def initialize()
        data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
                
        # Create an instance of Presentation class
        pres = Rjb::import('com.aspose.slides.Presentation').new(data_dir + 'vbamacro.pptx')

        # Access the Vba module and remove 
        pres.getVbaProject().getModules().remove(pres.getVbaProject().getModules().get_Item(0))

        # Write the presentation as a PPTX file  
        pres.save(data_dir + "RemoveVBAMacro.pptx", Rjb::import('com.aspose.slides.SaveFormat').Pptx)

        puts "Removed VBA Macro, please check the output file."
    end      
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asposeslidesjava-0.0.2 lib/asposeslidesjava/VBAMacros/removevbamacro.rb
asposeslidesjava-0.0.1 lib/asposeslidesjava/VBAMacros/removevbamacro.rb