Highlight text in SharePoint document preview - sharepoint

This SO question shows a programmatic way for highlighting text in a word document. I am looking to do the same thing but for a document opened inside Sharepoint 2010.
From this link I understand that a document can be opened inside sharepoint itself using the office webapp (a bit of a hack in 2010, better in 2013) or in the local user instance of word/excel/...
I would need programmatic, read-only control over that preview. Mainly to highlight particular text fragments. I would think it should be possible to do this for the webapp instance but not for the locally started instance. Though I have't found any example code or pointers how to approach this. Commercial solutions are not an option.
Edit:
Related question
There seems to be some kind of an api
for the Excel web app but not for word

As far as I can see this is not possible, but happy to be proven wrong. The only solution I see is to do the highlighting on the server side up front (e.g., using com or openxml libs) in a separate copy of the document or on the fly (e.g., like here). Then serve the processed document to the client.

Related

Excel and Office.js access to CustomXml Part

Our Web Application stores/creates documents for clients. Our clients download these document which contain custom tagging parts which are client specific and stored the customxml part in both Excel and Word documents. We currently use an activex ribbon bar app that retrieves these parts and displays them for the user. This allows them to access these parts to be inserted into the document by the ribbon bar app.
We then sought a better and more compatible way to accomplish this to get away from activex but also allowing clients that use older version of Word and Excel to continue to use the activex control.
Microsoft assisted us in creating our Word Addin that used Angular and Office js to accomplish this in MS Word.
Now we need to replace our Excel ribbon bar app. I am leading the creation of this tool and found that Excel API currently does not allow access CustomXml Part in the document structure.
Is there any way to access the customxml part in Excel?
Is there any plans to allow access in a future release.
Can you recommend a best practice for storing and retrieving these part if the first two question are no.
We are using Angular2 and Office.js to create the new addin.
I believe this is coming soon in API set 1.5 : see the open spec details here
https://github.com/OfficeDev/office-js-docs/tree/ExcelJs_OpenSpec/reference/excel
As Charles mentioned, Custom XML parts API will be available as part of Excel API #1.5 set.
If you have 1702 build of Excel, you can test this out now. See here for details.

Find current host in Office add-in

I want to know whether my add-in is running in Word, Excel or Powerpoint. I need a solution that works in the desktop version of the applications (but preferably for the online version as well).
Is this somehow possible?
The reason I'm asking is twofold:
I want to style the add-in app in the colors of the host application.
I submit the document to a webservice. I want to provide a filename as well and need to know if I should postfix with .docx, .xlsx or .pptx.
There isn't a straightforward way to determine the current host. I would also discourage going down the "single manifest, multiple hosts" path in the first place. As the APIs have matured, more and more functionality has become host specific. The most obvious examples being ExcelAPI and WordAPI.
This isn't to say you should build multiple web apps, just that you should maintain multiple manifests. Each manifest can specify a distinct "landing page" where you can make some session level settings that tell the rest of the App which host it's talking too.
The other benefit of this approach is you can be more selective about which Add-in Commands you declare and where in the ribbon they show up. In some cases you might have functions available in Excel that don't show up at all in Word or PowerPoint.

Embedding an excel document into an application with excel online

I have been experimenting with excel online shared link to be able to embed an excel document to our internal web site. But this method is not viable because we can't actually make a public link because the data is private.
I was wondering if it was possible to embed an excel document any other way. I can add that we need an excel document with an add-in attached to it. I might have done something wrong but in my test, my add-in didn't show up in the embedded version of the document. I also noted that functionality seemed greatly reduced. Even with read-write permissions, I could input some data but couldn't delete anything which wasn't very useful in our case.
Ref:https://support.office.com/en-US/article/Share-it-Embed-an-Excel-workbook-on-your-web-page-or-blog-from-OneDrive-804e1845-5662-487e-9b38-f96307144081
Our goal is to be able to :
embed excel document into an application.
feed external data into the excel document when opened or on user input (done by an add-in)
user interaction (read-write-delete according to defined locks and column visibility)
save the relevant data to storage (done by an add-in)
save the document to OneDrive and/or to a specific location.
I am wondering if there is any solutions (now or in-progress) that would allow us to have most of the functionality of excel online while being managed by an application.
Possible solutions?:
We might have a partial solution where instead of creating a shared link, we could integrate our application to excel instead of doing thing the other way around. But it doesn't solve how to handle Microsoft accounts required to access the documents.
You'd have to do the heavy lifting in JavaScript I'm afraid and add-ins are out of the question. See a very rudimentary example of how to interact with an embedded Excel file here:
http://www.jkp-ads.com/Articles/embeddedexcel00.asp

Is it possible to develop for Office 365 (confusion due to new-to-365)

I'm not even sure if it's possible at all. Earlier, I've been designing addons to Outlook and Excel (using VSTO and VBA). Now, my company got into this Office 365 thinking and we have all our environment online, no local software at all, strictly and only web client approach.
It's got its advantages. But the downside is that out support have no clue how it works (except to tell us to click the settings and look for options, sigh). So, I wonder if it's possible to develop and somehow upload my own customizations (NB we have no servers in the cloud - everything is provided on SAS basis).
Suppose I'd like to:
mark all emails from a certain sender with yellow background in the list in Outlook, or
highlight every occurrence of the word "donkey" in the text mass in Word.
Is it doable at all?
I've googled for it but all I can see is that there's an API and that we need to runt the stuff on our own servers. Am I just confusing myself here?
First of all, if you have O365 subscription, you actually still have the ability to download all desktop version of Office. So your existing customizations should still work on Desktop version of Office.
Second,check out Office Add-in on dev.office.com. Office Add-ins extend the functionality of Office with a web app that lives within Office applications. They work similar to traditional VBA add-ons and we have a rich set of API that helps you interact with Office. This is basically a web app with JavaScript, HTML and CSS. You can build it with any tools you are familiar with and host it anywhere. It is really easy to build and let us know if you have more questions.
Thanks,
Sky
Your best bet for highlighting messages from specific senders would be to use the Outlook REST APIs to access the messages and either stamp a specific category color on the messages, or a flag to highlight the message in the list view. That approach would work across both Web, Outlook, and even Mobile (if you use flags). The new Outlook add-in model is powerful and works for Outlook on the Web, as well as Outlook on Windows, but doesn't allow you to update the colors of the list view add-ins.

Drag and Drop files into a SharePoint webpart to upload into DocLibrary

Is it possible to create a SharePoint (wss3 or MOSS 2007) webpart, to allow files to be dragged and dropped onto it, which would then upload the files into a predefined document library ?
I imagine that this would require some form of client side scripting (Ajax ?), but my knowledge in ajax is a bit sketchy.
From my exploration so far, I'm thinking:
User drags file onto 'drop zone' Webpart.
This action triggers some code
This code Loads the file into a SharePoint library (like this : Uploading a File to SharePoint)
Any pointers would be gratefully recieved
Many thanks.
Nick
Well,
What I'd do is, like you said, a web part with javascript that allow the user to drag and drop some files into a zone inside the webpart. Once the user has finished I'll upload those files after click on a Button of the webpart. I think is better to work with SharePoint in an unique transaction and not upload and delete files using AJAX. So, the drag and drop functionality can be done using some kind of javascript like Scriptaculous and the other one like a classic postback.
You might also want to look at another way to perform this. If you do it in a webpart, you will need to add that webpart in every sites where you want this fonctionnality to work. You might want to try Sharegate (www.share-gate.com). It's a end user tool that allows you to drag and drop file from your computer (or any SharePoint list / library) to any SharePoint library. By dropping the document inside the library, you will be ask to select a property template where you can define all the properties attach to your document. Not only you will drag and drop documents, but you will structure the information at the same time. Hope this was helpful!
Perhaps my reply is little bit irrelevant to your post!
I think upload files to SharePoint is not a painstaking job, the build-in feature is enough for us to upload files.
The trouble, I think, lies in the check in process, may be that is what you should do!
Altought maybe not that important now, but there is a SharePoint addon on CodePlex now
that allows files to be uploaded by Drag & Drop into SharePoint document libraries.
Available here: http://dndupload.codeplex.com/
Works in Firefox & Chrome, uses FileApi from HTML5, supports both SharePoint 2007 & 2010.

Resources