I am using outlook mail api to receive and show mail content which can also include attachments of any type. I had managed to show pdf files using pdf-view module but for excel and doc files no such module or anything exist.Could anyone suggest something for this.Any help would be appreciated.Thank you
So what I found from my research is you can not display a word file using java script or angular, it only opens up a dialog box to download the file.
As an alternate what you can do is convert word file to HTML and preview it in browser. Mammoth.JS is the best option for this.
Related
I'm currently building a new ticketing system for my workplace. When an email is received it generates a ticket number and few files in a SharePoint document library. One of those folders is "Attachments" where the flow I am building is supposed to put any attached documents. As far as I can tell I've followed other guides to the tee, however it renders the attachments un-openable. After downloading the files it did make and opening them in Notepad++, the content of the files is completely different and I can't seem to figure out why... I've been testing mostly with *.docx files, but it does the same for other file types as well. Please see attached screenshot of the attachments getter part of the flow. Any support is greatly appreciated!
Attachment Getter Screenshot
Note: This is how the guides told me to do it, however I did try changing the "File Content" box to "Attachments Content" instead of "Current Item" from the dynamic content menu to no avail.
Try use attachments content directly:
How to save Email Attachments to your SharePoint Document Library
Can you try to get the file content.
File content should help getting attachment. You will have to recreate a file though.
For this problem, please check if you have set the value of Include Attachments in the trigger to Yes.
I'm trying to access to my iCloud Notes with a python script using pyiCloud framework, but when I try to list the notes it seems that Documents folder is empty. Does anyone know how I should make that?
>>> api.files['com~apple~Notes']['Documents'].dir() It returns:
>>> []
It sounds like you have an authentication problem that you can't get access to your Notes from the file storage (the UbiquityService). This issue might give you some more clues.
On the other note (!), I found the following a better way to get my Notes exported. I have tried a couple of ways mentioned around the web. Although there is no in-app solution to export Notes in a format other than PDF files, I have stumbled upon the following two solutions:
Export in Markdown (or in other formats in the paid version) via the Bear app. I found this way easier and of more quality in terms of keeping the formatting, attachments, etc:
Download the Bear migration Workflow script from here and follow the instructions.
[optional] At this point, you have the HTML files with inline encoded images. Use my script to decode images to get regular HTML files with the images in an accompanying directory.
Install Bear and import the exported files from Notes.
Export the files as Markdown, HTML, or whatever format you desire from File -> Export Notes within the Bear app. Don't forget to check the "Export attachments" box in the export dialog.
Export in HTML (and then convert to Markdown if you want) via the Notes Exporter app. The app gives you HTML files with inline encoded Base64 images saved with .txt extension (?!). Although I personally like this way as it generates output files that mimic closely the original Notes, the hyperlinks are missing in the exported files (it still keeps the hyperlink coloring though):
Download Notes Exporter from here.
Export Notes to the path you choose.
[optional] Rename file extensions to .html.
VoilĂ , now you have your Notes as HTML files with the same formatting and images.
Decode inline Base64 images and save HTML files with images saved in a separate adjacent directory using the script that I wrote for this:
https://gist.github.com/SHi-ON/945ea2272ea4bb29e13bd0305370da90
Hope this helps to give you an idea!
I have a OneNote document in archive format, downloaded from SharePoint using CSOM. I am trying to extract the plain text content from it using IFilter, but the process fails with FILTER_E_UNKNOWNFORMAT (0x8004170C) error. I have OneNote installed and the IFilter for .one files is registered properly.
If I open that document in OneNote, it displays a small banner that offers conversion to editable format. After the conversion, I am able to load the file into IFilter and read the text. I am also able to do the same with notebooks created locally.
I'd like to find a method to achieve the same result programmatically, without user interaction. I've tried to use OneNote interop libraries to convert the notebook into PDF, then extract the text from PDF file, but it seems like an overkill to me.
Microsoft.Office.Interop.OneNote.IApplication app = new Microsoft.Office.Interop.OneNote.ApplicationClass();
try
{
app.OpenHierarchy("d:\\Note.one", string.Empty, out string hierarchyId, Microsoft.Office.Interop.OneNote.CreateFileType.cftNone);
app.SyncHierarchy(hierarchyId);
app.Publish(hierarchyId, $"d:\\Note.pdf", Microsoft.Office.Interop.OneNote.PublishFormat.pfPDF);
}
finally
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(app);
}
I know I can access the OneNote document's content directly, without converting to PDF, but I want to avoid using interop libraries if possible.
Does somebody have experience with reading OneNote documents programmatically, or does somebody know a tool that makes the above mentioned conversion? Or is there a different way of downloading OneNote documents from SharePoint that does not produce such archived files?
Any suggestions would be appreciated.
I have created an embedded pdf with the insert> object > create from file> browse > display as icon function in excel.
I would like to then use the embedded pdf as an attachment for my outlook email using vba code. I have tried to use the .Attachment.Add code but it seems to fail to detech an embedded object.
Could anyone advise a correct code? Thanks!
Get the file from the source?
I don't understand why you would need to embed the.PDF object in the workbook, if you're going to be emailing it separately anyhow...
Regardless, you could just grab the actual/original .PDF to attach a copy to the email, directly from the same location from where it was embedded. (If it's not there, what happened to it?)
Another option:
As soon as you right-click the embedded object, Excel 2016 "gets ready" for you to open it by extracting it to your local temp folder. (I'm unsure whether this applies to previous versions.)
Therefore, you could programmatically right-click the embedded icon, and then check the temp folder located at the path that you'll find stored in Environ("temp"). One or more copies of your file will be located there (and it should be the 'newest' PDF).
Yet another option:
Excel's XLSM file is simply a compressed ZIP file, if you change the extension. You could programmatically make a copy of the file, changing it's extension to .ZIP.
Embedded object are stored as .BIN files within the ZIP file in the xl\embeddings\ folder. It would have to be extracted and then renamed back to a PDF. Note that this method is a little flakey and won't work with all PDF's.
More Information:
VBA Express : Save embedded PDF file as a separate PDf file
How-to-Geek : How to Extract Images, Text, and Embedded Files from Office Documents
Requirement:
1.I need to export a table as a excel file.
2.I render it in a html page at first. I have a button to export to html.
My opinion:
1.I get the html from page:
document.getElementById('content').value = document.getElementById('containerId').innerHTML;
form1.submit();
2.I get it from server, response.ContentType = "application/vnd.ms-excel;" // it need the client has installed Microsoft Excel.
3.I got the right Excel file "XXXX.xls".
4.BUT BUT BUT, when I open it, it's alert a waring tell me like
"it's not the right format of Excel, are you confirm to open it?"
I'm feel sorry to see it.
So I want to import the HTML section into a Excel file, then response the right Excel file to USER-AGENT.
I have use the Aspose.Cells library in my project, I don't know how to use it to finish the task, Or is any other solution to solve it ?
If you need to parse html tags/portion to Excel spreadsheet using Aspose.Cells for .NET, you may use Cell.HtmlString attribute to set your desired html code segment in a cell, it will be parsed accordingly in the generated Excel file. Mind you, not all the html tags are supported at the moment.
Aspose.Cells for .NET also supports to convert an Excel file to Html file directly, see the documents on which file formats are supported for conversion, it may help you for your reference:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/opening-files.html
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/saving-files.html
If you still have some issue/confusion, kindly give us details with your sample code using Aspose.Cells API, we can help you.