Delete or replace an image in PowerPoint using OfficeJS - powerpoint

I am building an Office JS add-in for PowerPoint, which operates on images of a certain type. I want to be able to delete or replace/update such images, but I cannot find the correct APIs to do this either on a single selected image or even any old image(s).
The Office JS API does not appear to have any PowerPoint specific methods, so it seems I will have to rely on what is available in the Common API. There is no obvious delete method visible.
I am already calling GetFileAsync (similar to this guide) in order to look at the file contents. I could presumably modify those contents, but haven't tried, since I cannot see an API that allows me to re-save those modifications.
Have I missed any useful info?

Related

How do you access content in a word document? (like Grammarly does)

I want to create a program that works like an autocomplete box for Microsoft Word. For that, I need some way of reading the contents of the page and getting the positions of words. I know that Microsoft has made a Javascript API for creating plugins in the form of side panes, but that's not what I'm after.
Grammarly manages to read the contents of the document and even underline specific words.
Maybe they have some agreement with Microsoft? Or could they be using some hacky solution? I did try to use win32api with both Python and C++ but didn't succeed.

Generate custom Finder thumbnails for some file types

I'd like to be able to generate my own thumbnails for some image files with custom extensions (say, a .canon file that is really a TIFF), so that Finder would use them.
I don't want to change the file contents (nor am I interested in the embedded tiff thumbnail).
Creating the thumbnail from the file's contents would be easy, the tricky part is integration. Does anyone know if it's possible?
The custom extensions won't be associated to any/other app.
I've done a lot of iOS development but know very little about OS X components.
If it's not possible to use Finder at all, is it at least possible to store the thumbnails in resource forks and have them used by, say, a custom filesystem browser?
File thumbnails, as well as full-size previews (which are displayed when you tap the space bar), can be generated dynamically by Quick Look plugins for any file type that they're registered for. The thumbnails do not need to be stored in the file, although you can certainly use pregenerated thumbnails if they're already in there.
For more information on Quick Look, please refer to Apple's Quick Look Programming Guide.

Possible to include an image in the meta data in code? VS 2013

I would like to be able to include a screenshot of a control inside my code, this way making control identification easier for new members on my team, is such a thing possible?
Maybe even the ability to just have the image on a network share with the path in a comment, and then have a plugin that when hovering over the link brings up the image?
EDIT (More detail):
I'm creating a test project, the application under test has over 1000 controls, some of them are similar in name and purpose, this can make it difficult at times for developers to reuse the API I am creating because the control name is simply not enough for quick identification of the control in use.
I use the word API very loosely too, none of this stuff will be consumed in web services, and it will always be white box with developers including a project reference and have direct access to the source code.
For every form in my application (The test one), I have a controls.cs file where all the controls for that form in the application under test are listed - This is where I want the hover to screenshot ability in the control definitions.
Another sure factor is that all developers will be using VS2013 (For now the base version), later this could be update 1 or 2.
As the initial author and senior developer on this project, these hover / image references (in the code) will be as useful to me personally as any 3rd party developers, or any later developers to join the initiative.
Thanks again, and I added a bounty!
I believe you can use Whole Tomato's free SourceLinks Visual Studio extension to do what you want - or at least get pretty close to it.
Built-in Functionality:
Out of the box, the extension allows you to specify comment patterns you want users to be able to take an action on. Once the patterns are specified, SourceLinks will highlight any occurrences of those patterns in the text editor. You will be able to double click the highlighted items and perform a pre-configured action (such as opening a link in an internal/external browser, or launching an executable).
You can see an example in the SourceLinks configuration dialog shown below:
(source: wholetomato.com)
So you could use this feature pretty painlessly to define a keyword such as Control Image and then put comments like the following in your code:
// Control Image: my_smart_list.jpg
SourceLinks would allow you double click this text, and you could have that configured to launch the image (using a file:// or http:// url depending on how and where your images are stored) either inside Visual Studio in it's internal browser, or in an external browser.
Custom Tooltips!
Now, if you want to put in some more effort into this and actually write some code, then SourceLinks allows you to create API Extensions to display custom tooltips when the user hovers over the marked text in the editor. The default installation of SourceLinks comes with sample API extensions that you can copy to create your own. See the article linked at the very top of the answer for more details on these samples.
This post in the SourceLinks forum informs us that SourceLinks expects the custom API Extension to return the tooltip value as FlowDocument XAML text. This is awesome news for us, because a FlowDocument can contain many types of elements, including formatted text, hyperlinks, and images.
Imanges in a Flow document can be specified both inline as well as externally.
Hope this helps!
I would use doxygen -- create the images somewhere in the source tree and use doxygen comments. You can embed the \image command in source comments (see docs) and doxygen will generate all the HTML documentation from there. I think doxygen is a great tool for documenting a codebase as you can generate the documentation directly from comments in the source and distribute or host the HTML separately.

Tiddlywiki: embed/link to .msg

I'd like to use Tiddlywiki for a personal knowledge base. In my work flow a lot of content comes in as Outlook emails threads.
Is there a smart way to refer to this content without fully copying over the whole text to each and every tiddler manually?
Maybe saving Outlook mail thread as .msg file, placing it locally and referring to that file might work. The tiddler then may hold some basic summy, but whole detail content lies in the .msg file.
Any ideas?
I am in such case (more struggling with TiddlyWiki, which is great but lacks documentation currently). I ended up using the outlook:oid url-style that opens the mail in outlook. However, it's difficult to retrieve a mail oid, especially as this id changes when copying (and maybe moving) the mail to other folders/pst files.
In my case, I use some outlook mailbox parser that detect specific markup (categories, actions), and take appropriate actions (move them, create the outlook:oid link somewhere, etc). It's ugly but does the job.
You've essentially answered your own question. Alternatively, use gmail or the likes to get proper links that only you can follow.

How to customize the windows shell to display files from a remote source and allow custom drawing?

Is it possible, (via some shell extension or similar) to customize the Windows shell (explorer.exe) to accomplish the following?
Make it, upon navigating to a predefined path:
draw over its surface - custom background, or even add custom forms for data input
display custom listview items based on the "virtual" path provided (something analogous to what explorer is doing when browsing a FTP repository - the items shown are not contents of a local folder, but rather some "virtual" items physically located on the FTP server)
The idea is to reuse the visage and navigation elements of Explorer without re-implementing the whole functionality and make it look native on all Windows versions for a remote file browser (file lists+files alone served by a custom web service).
I think you need to implement a Explorer Namespace Extension. There is some good information floating around on codeproject etc that you will probably need since the official documentation is not the best.

Resources