Sha256: e8da106de515e0fc0cd0e5e87159057e21ac57a1ac2fdb9d0a09eab44239afc5

Contents?: true

Size: 761 Bytes

Versions: 1

Compression:

Stored size: 761 Bytes

Contents

module Asposewordsjavaforruby
  module RemoveField
    def initialize()
        # The path to the documents directory.
        data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'

        # Open the document.
        doc = Rjb::import('com.aspose.words.Document').new(data_dir + "Field.RemoveField.doc")

        #ExStart
        #ExFor:Field.Remove
        #ExId:DocumentBuilder_RemoveField
        #ExSummary:Removes a field from the document.
        field = doc.getRange().getFields().get(0)
        # Calling this method completely removes the field from the document.
        field.remove()
        #ExEnd

        # Save the document.
        doc.save(data_dir + "Field.RemoveField Out.doc")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asposewordsjavaforruby-0.0.5 lib/asposewordsjavaforruby/removefield.rb