Python: Access embedded OLE from Office/Excel document without clipboard

前端 未结 3 957
不思量自难忘°
不思量自难忘° 2020-12-18 23:11

I want to add and extract files from an Office/Excel document using Python. So far adding things is easy but for extracting I haven\'t found a clean solution.

To mak

3条回答
  •  既然无缘
    2020-12-18 23:51

    I built a python module to do exactly this check it out over here. https://pypi.org/project/AttachmentsExtractor/ also the module can be run on any os.

    after installing the library use the following code snippet Code:

     from AttachmentsExtractor import extractor
                
     abs_path_to_file='Please provide absolute path here '
     path_to_destination_directory = 'Please provide path of the directory where the extracted attachments should be stored'
     extractor.extract(abs_path_to_file,path_to_destination_directory) # returns true if one or more attachments are found else returns false.
    

提交回复
热议问题