How to add element web Word in SharePoint Online

Hey how are you?
Currently I have Office 365
I create a Sharepoint site
and add a web part to see the conetendio
an exel file, the web part
is working correcamente me.
I'm trying to add a web part to
the contents of a Word file but can not find
the option.
anyone can help me to add the web part
to Word?
thanks

SPUser user = SPContext.Current.Site.RootWeb.EnsureUser(*loginname*);
Guid siteID = SPContext.Current.Site.ID;
Guid webID = SPContext.Current.Web.ID;
using (SPSite site = new SPSite(siteID))
using (SPWeb web = site.OpenWeb(webID))
try
web.AllowUnsafeUpdates = true;
//Get the group for this web
SPGroup oeGroup = web.Groups[*myGroupName*];
if (oeGroup == null) return false;
//Add the User to the OE Group
oeGroup.AddUser(user);
oeGroup.Update();
catch (Exception ex)
//Error Handling
finally
web.AllowUnsafeUpdates = false;
}http://sharepoint.stackexchange.com/questions/24966/adding-spusers-to-spgroups-programmatically-changes-user-idhttp://www.microsoft.com/en-us/download/details.aspx?id=17069

Similar Messages

  • How can I send an email from Sharepoint Online using sandbox solution?

    How can I send an email from Sharepoint Online using sandbox solution?
    If possible I do not want to use workflow.
    Is It possible to do it without using workflow?

    hello Steven Andrews,
    when any user sends a message using contact us page in SharePoint online.
    1. We are inserting item in Contact Us List . - This is working fine
    for anonymous users also. We have used Office365 anonymous codeplex wsp and it is working fine. Anonymous user is able to insert new record in the Contact Us List.
    2. Once, new record is inserted in Contact Us list, we want to fire email notifying thanks to the user on his email id as well as to our company x person for notification of new inquiry. 
    We tried using Workflow having impersonation step for  anonymous user but it is not working for Anonymous users. Workflow is able to sent the email if someone logged into system but not working for Anonymous user although workflow is getting started
    but not able to send email although used Imperonsation step.
    We are stuck into implementing second step.

  • How to install app using powershell in sharepoint online - office 365?

    How to install app using powershell in sharepoint online - office 365?

    Hi
    check this similar post
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/1f0cd45a-00e1-4452-bafe-83c6ee3a59db/can-i-deploy-a-sharepointapp-to-office-365-using-powershell?forum=appsforsharepoint
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • How to hide the MS Word Web App in SharePoint Online Document Library

    Hi Guys!
    Badly needed your input on this scenario. I've created a document library in
    SharePoint Online but when I add a document I wanted the MS Word Web App toolbar
    to be hidden as I didn't want to have the document printed  and downloaded. Just want to have the file in read only mode.
    I've come across subscription to IRM of Office 365 as a solution but it's kinda expensive for this need.
    Any idea on how to resolve this scenario would be greatly appreciated.
    Thanks,
    Venus

    Hi!
    Even if I give a view-only permission to the user, still the print button is available and the document can still be downloaded to PDF file.
    Also, the permission rights given to the users of the document library is contributor. But after routing for approval and the content is approved. It should be read-only even to the one who authored the document.
    I've checked also IRM for a solution but unfortunately what we have is E1 package so IRM is out of the option.
    Thanks,
    Venus

  • How to call COPY web service from sharepoint in SAP

    Hello Experts,
    I want to call COPY web service from SharePoint in SAP  web dynpro / JAVA application.
    However, when I try to connect to web service and download wsdl using   http:// <hostname:port>/_vti_bin/copy.asmx?wsdl
    it results in Unauthorized error and doesnt complete the setup. Detail error is :
     Error occurred while downloading WSIL file. Error message: Deserializing xml stream  http:// <hostname:port>/_vti_bin/copy.asmx?wsdl
    failed.com.sap.engine.services.webservices.espbase.wsdl.exceptions.WSDLException: Invalid Response Code: (401) Unauthorized. The requested URL was:"Connect to 
    http:// <hostname:port>/_vti_bin/copy.asmx?wsdl , used user to connect: userid"
    I am trying to connect with server user account. Any idea on what authorizations might be required or any help on the scenario .
    -Abhijeet

    Here's an example on how to delete a list item, hopefully this helps
    package com.jw.sharepoint.examples;
    import java.io.File;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.Properties;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.microsoft.sharepoint.webservices.CopySoap;
    import com.microsoft.sharepoint.webservices.GetListItems;
    import com.microsoft.sharepoint.webservices.GetListItemsResponse;
    import com.microsoft.sharepoint.webservices.ListsSoap;
    import com.microsoft.sharepoint.webservices.UpdateListItems.Updates;
    import com.microsoft.sharepoint.webservices.UpdateListItemsResponse.UpdateListItemsResult;
    public class SharePointDeleteListItemExample extends SharePointBaseExample {
     private String delete = null;
     private String deleteListItemQuery = null;
     private String queryOptions = null;
     private static final Log logger = LogFactory.getLog(SharePointUploadDocumentExample.class);
     private static Properties properties = new Properties();
     public Properties getProperties() {
      return properties;
      * @param args
     public static void main(String[] args) {
      logger.debug("main...");
      SharePointDeleteListItemExample example = new SharePointDeleteListItemExample();
      try {
       example.initialize();
       CopySoap cp = example.getCopySoap();
       example.uploadDocument(cp, properties.getProperty("copy.sourceFile"));
       ListsSoap ls = example.getListsSoap();
       example.executeQueryAndDelete(ls);
      } catch (Exception ex) {
       logger.error("Error caught in main: ", ex);
     public void executeQueryAndDelete(ListsSoap ls) throws Exception {
      Date today = Calendar.getInstance().getTime();
      SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
      String formattedDate = simpleDateFormat.format(today);
      String queryFormatted = String.format(deleteListItemQuery,formattedDate);  
      GetListItems.QueryOptions msQueryOptions = new GetListItems.QueryOptions();
      GetListItems.Query msQuery = new GetListItems.Query();
      msQuery.getContent().add(createSharePointCAMLNode(queryFormatted));
      msQueryOptions.getContent().add(createSharePointCAMLNode(this.queryOptions));
      GetListItemsResponse.GetListItemsResult result = ls.getListItems(
        properties.getProperty("folder"), "", msQuery, null, "",
        msQueryOptions, "");
      writeResult(result.getContent().get(0), System.out);
      Element element = (Element) result.getContent().get(0);
      NodeList nl = element.getElementsByTagName("z:row");
      for (int i = 0; i < nl.getLength(); i++) {
       Node node = nl.item(i);
       String id = node.getAttributes().getNamedItem("ows_ID").getNodeValue();
       String fileRefRelativePath = node.getAttributes().getNamedItem("ows_FileRef").getNodeValue();
       logger.debug("id: " + id);
       logger.debug("fileRefRelativePath: " + fileRefRelativePath);
       String fileRef = properties.getProperty("delete.FileRef.base") + fileRefRelativePath.split("#")[1];
       logger.debug("fileRef: " + fileRef);
       deleteListItem(ls, properties.getProperty("folder"), id, fileRef);
     public void deleteListItem(ListsSoap ls, String listName, String listId, String fileRef) throws Exception {
      String deleteFormatted = String.format(delete, listId, fileRef);  
      Updates u = new Updates();
      u.getContent().add(createSharePointCAMLNode(deleteFormatted));
      UpdateListItemsResult ret = ls.updateListItems(listName, u);
      writeResult(ret.getContent().get(0), System.out);
     public void initialize() throws Exception {
      logger.info("initialize()...");
      properties.load(getClass().getResourceAsStream("/SharePointDeleteListItemExample.properties"));
      super.initialize();
      this.delete = new String(readAll(new File(this.getClass().getResource("/Delete.xml").toURI())));
      this.deleteListItemQuery = new String(readAll(new File(this.getClass().getResource("/DeleteListItemQuery.xml").toURI())));
      this.queryOptions = new String(readAll(new File(this.getClass().getResource("/QueryOptions.xml").toURI())));
    Brandon James SharePoint Developer/Administrator

  • How to add custom file icons on SharePoint 2010 document library?

    Hi there,
    In a document library SharePoint shows the PDF and Word etc icons all fine - however we have a custom file format with a custom icon. Is this possible to add this custom icon for our custom extension? How?
    Thank you so much.

    Hi,
    You could accomplish your requirement by using jQuery with these steps, and this code is using jQuery to modify it on the current page, if you would like to make it work on all library, you need to choose the former method or add this JQuery script on all
    library pages manually:
    Upload a custom icon to file “14\ Template\Images” or your SharePoint document library.
    Add this code below in the document library that you want to extend your custom icon, you could add code by following these: Click edit page in the document library -> add a web part -> choose Content Editor -> click edit source in the Ribbon ->
    add the source below -> click OK.
    <script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function(){
    var fileObject = $("[title$='docx']");
    for(var i=0; i < fileObject.length; i++){
    //fileObject[i].outerHTML="<img width=\"16\" height=\"16\" title=\"test.docx\" alt=\"test.docx\" src=\"/_layouts/15/images/custom.png\" border=\"0\">"; // upload your custom icon to file ” 14\ Template\Images”, replace your src URL
    fileObject[i].outerHTML="<img width=\"16\" height=\"16\" title=\"test.docx\" alt=\"test.docx\" src=\"/sites/sharepoint2013/Shared%20Documents/custom.png\" border=\"0\">"; // upload your custom icon to SharePoint document library, replace your src URL
    </script>
    The screenshot below is my result:
    Best Regards
    Vincent Han
    TechNet Community Support

  • How to add repeating comments features in Sharepoint Announcement List.

    I have a challange to add commenting features in Announcement lists identical to sharepoint blogs.
    When super user adds Announcement  in the team page, i wanna display add comments  right underneath the new announcement to  people with contributer access to provide feedback to the item. It is very identical as default sharepoint issues
    list where people can provide multiple comments that provides time stamp and user info about the contributor of the comment. 
    Any help will be appreciated.
    Thank You
    Napster123

    Hi Napster123,
    Please check this. It’s about how to add comments to SharePoint. I think Steve’s suggestion would be helpful.
    http://sharepoint.stackexchange.com/questions/495/how-to-add-comments-to-web-page-in-sharepoint
    Hope this helps.
    Thanks.
    Pengyu Zhao
    TechNet Community Support

  • How to add elements into Object[][] type of list, in runtime?

    I have Object list, ie.
        final Object[][] data = {
            {"January",   new Integer(150) },
            {"February",  new Integer(500) },
            {"March",     new Integer(54)  },
            {"April",     new Integer(-50) }
        };How can I dynamicly add new elements in it, at the runtime?
    Thank you in advance!

    Do I have to remove 'final' for that, and then add
    elements?
    No. you can't change an array's size.
    You can do this
    Object[][] arr = new Object[numRows][numCols];But once you've created it, its size can't change.*
    I don't know what you're doing, though, and what actual data you're putting in, but Object[][] holding rows of [String, Integer] is almost certainly a poor data structure. Think about creating a class the represents one "row" here and then create a 1D array of that class.
    * Okay, you can kinda sorta effectively "change" the size of second and subsequent dimensions, since a multidimensional array is an array of arrays. I wouldn't recommend it though: int[][] arr = new int[3][2]; // a 3 x 2 rectangular array of int--it's  an array of array of int, with 3 "rows", each of which is an array of int with 2 elements.
    arr[0] = new int[10]; // now it's a jagged array whose first row has 10 elments instead of 2Here we haven't changed an array's size, just replaced one of its elements, which is also an array, with a new, larger array.

  • REG: How to add elements onto htmlb table cell.. URGENT PLZ HELP

    Hi all,
    I have created a htmlb table. And the jsp code is as follows
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean id="myBean" scope="application" class="com.linde.myaccounts.util.TableBean" />
    <hbj:content id="myContext">
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
       <hbj:tableView id="myTableView1"
                          model="myBean.model"
                          design="ALTERNATING"
                          headerVisible="false"
                          footerVisible="false"
                          fillUpEmptyRows="true"
                          visibleFirstRow="1"
                          visibleRowCount="5"
    </hbj:form>
      </hbj:page>
    </hbj:content>
                          width="500 px" >
    </hbj:tableView>
    I have used a table bean by which I am getting the column header names. I have 5 columns, I have to add input field in the first column, checkbox in the second column, leave the third column blank, checkbox in the fourth column and again a input field in the fifth column. I am not understanding on how to add this elements onto the table. Will I add it from the JSP using <hbj:tableViewColumns> tag or I have add them in the bean or in the dynpage. Kindly someone give me the code for this...
    This is very urgent..Kindly help...
    Thanks in advance,
    Priyanka

    Hi,
    Have you tried looking at the examples that come with the PDK for all of the HTMLB elements?  From memory, there should be a small table example or 2 that have different types of columns shown similar to what you want - they have the full source code with them for you to look at.
    If you are working in a portal, go to the Java Developer tab and I "think" there should be a tab linking to HTMLB documentation and examples - sorry I can't be more specific but I don't have access to a portal at the moment so am trying to remember.
    Gareth.

  • CRM2007 How to add a Web Dynpro ABAP application to a CRM business role

    I am investigating CRM2007 UI framework and I cannot seem to find a way to add a custom made Web Dynpro ABAP Application (created in CRM 4.0) to a business role, or how to add a custom transaction created in classic ABAP (transaction created via se93, progam created via se38). Whatever I do, I only see BSP components. I am using transaction BSP_WD_CMPWB.
    Next to this it seems you can add/integrate Visual Composer applications to (there is an entry in spro called "integration of the visual composer in BI"). However, I presume we first have to meet the requirements for the portal integration in SAP CRM 2007 as described in spro. If somebody knows how this works, that would be great!
    kind regards
    Angelique Heutinck

    Hello Angelique,
    It should be possible to call web dynpro applications from the L-shape menu of CRM UI (check transaction CRMC_UI_NBLINKS). As for the old GUI transactions, you can embedd them also via transaction launcher using CRMC_UI_NBLINKS (search for "transaction launcher" in this forum, there is plenty of information on it).
    Best Regards,
    Yevgen
    Edited by: Yevgen Trukhin on Jun 19, 2008 11:53 AM

  • How to add a web site to the "Java" preferences?

    Apple states the following regarding Safari 6.0.4:
    "When you first visit a website that requires the Java web plug-in, Safari presents a prompt similar to this one but containing the specific website ..."
    I didn't authorize a web site when i first visited it. Now, I'd like to add this web site to the list in the "Java" preferences in Safari 6.0.4.
    Is this possible and how?
    Thanks in anticipation.

    I noticed certain features simply do not happen in Safari with Java turned off when I recently changed ISPs and was making change of address at sites that had been using the earlier one. In several instances I clicked "Submit" or the like and got exactly no feedback. Which made no sense. Then, two days ago, in trying to price some Adobe software, when I clicked on a button for more information, again nothing happened. I went to Chrome, pasted the URL, clicked on the button and got a drop down information window.
    I came here because, when I went through the Help symbol at Preferences>Security but got no helpful instructions, so I wrote an explanation in the comment box, but when I clicked Submit THERE I got an error message that included something about a Java exception. I enabled Java and went back to try Submit again, with the same error!
    For the record, here is what I was trying to send to the comment-readers:
    Wanting to control where Java can be run, I clicked on "Manage Website Settings" and got an empty list.
    So I clicked on the Help button on the Preferences>Security page and came to help, which told me NOTHING about HOW to enter websites on that list, that empty list.
    Therefore, no help.
    Hunh! In trying to send this apparently I need to have Java turned on. See? That's just another indication of confusion out here in user land.
    Well, that didn't work either. I will try another route.  END OF NOT-SENDABLE COMMENT.
    Now I will web search for useful information. I have chosen to be kept abreast of this discussion, too.

  • How to add a Web Preview Server to Eclipse Mars

    I have been attempting to add a web preview server to my Eclipse Mars version. The only help I have found online is to open servers, right click, new, server then choose web preview from the IBM list.
    I can not seem to find the IBM folder unless I install Liberty Profile, and even then there is no web preview server listed. Is there anywhere I can download the server to install it to my eclipse? I can't find anywhere online to do so.
    Any help would be greatly appreciated. This is a fresh install of Eclipse Mars by the way.
    Thanks,
    Brian.

    On 7/15/2015 8:27 AM, Brian Hamill wrote:
    > I have been attempting to add a web preview server to my Eclipse Mars
    > version. The only help I have found online is to open servers, right
    > click, new, server then choose web preview from the IBM list.
    >
    > I can not seem to find the IBM folder unless I install Liberty Profile,
    > and even then there is no web preview server listed. Is there anywhere I
    > can download the server to install it to my eclipse? I can't find
    > anywhere online to do so.
    >
    > Any help would be greatly appreciated. This is a fresh install of
    > Eclipse Mars by the way.
    >
    > Thanks,
    > Brian.
    Just to confirm, am I correct in assuming the "HTTP Preview" and "J2EE
    Preview" servers under the Basic category aren't what you are looking
    for? I'm not aware of a "Web Preview" server.
    Cheers,
    Larry

  • How to upload local files to Offices365 SharePoint Online Site by C# Code?

    Hi all,
    I've some requirement needs to upload files from local to Office365 Sharepoint Online Site Document Library using C# code?
                   public static void upload()
    Uri uri = new Uri("siteurl");
                    ClientContext context = new ClientContext(uri);
                    var passWord = new SecureString();
                    foreach (var c in "password") passWord.AppendChar(c);
                    context.Credentials = new SharePointOnlineCredentials("email", passWord);
    Web web = context.Web;
                   FileCreationInformation newFile = new FileCreationInformation();
                    newFile.Content = System.IO.File.ReadAllBytes(@"C:\myfile.txt");
                    newFile.Url = "file uploaded via client OM.txt";
                    List docs = web.Lists.GetByTitle("Documents");
                    Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
                    context.ExecuteQuery();
    I don't know whether this method works and I'm always get issue for getting the ClientContext.
    Thanks for your reply.

    Please try below.
    public void SaveFileToSharePoint(string fileName)
    using (var context = new ClientContext("https://mydomain.com/"))
    var passWord = new SecureString();
    foreach (var c in "MyPassword") passWord.AppendChar(c);
    context.Credentials = new SharePointOnlineCredentials("[email protected]", passWord);
    var web = context.Web;
    var newFile = new FileCreationInformation {Content = File.ReadAllBytes(fileName), Url = Path.GetFileName(fileName)};
    var docs = web.Lists.GetByTitle("Documents");
    docs.RootFolder.Folders.GetByUrl("Test").Files.Add(newFile);
    context.ExecuteQuery();
    Bala

  • How to deploy SCOM Dashboard solution to sharepoint online

    i have come through many articles saying how to deploy scom dashboard solution to sharepoint server,
    but how do i deploy SCOM WSP solution to sharepoint online office 365.
    i need to show my SCOM dashboards on sharepoint online.
    Can anyone help me in doing this?
    Thanks & Regards, Suresh Gaddam

    Yes i did the same thing but when i hit activate it threw some error saying you cannot deploy farm solution to sharepoint
    This solution
    contains invalid markup or elements that cannot be deployed as part of a sandboxed solution. Solution manifest for solution 'c125f6b7-8c1e-40ae-86e2-bd2d5e568ca2' failed validation, file manifest.xml, line 14, character 4: The element 'Solution' in namespace
    'http://schemas.microsoft.com/sharepoint/' has invalid child element 'RootFiles' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'ActivationDependencies, FeatureManifests' in namespace 'http://schemas.microsoft.com/sharepoint/'.
    TECHNICAL
    DETAILS
    Thanks & Regards, Suresh Gaddam

  • Excel web part in sharepoint online

    Under Business data the excel web part not available in SharePoint online. Is Excel web part available in SharePoint online?
    Ravin Singh D

    Hi Ravin,
    so try following steps:
    1. Site Actions -> Site Settings -> Site Collection Features
    2. Scrolled to SharePoint Server Enterprise Site Collection features and click Activate
    3. Now Site Actions -> Site Settings -> Site Features
    4. Scrolled to SharePoint Server Enterprise Site features and click Activate
    Kind Regards,
    John Naguib
    Technical Consultant/Architect
    MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
    Please remember to mark your question as answered if this solves your problem

Maybe you are looking for

  • A/P Invoice added with incorrect price

    Good Moorning Experts. I've i little problem. I've added a A/P invoice generated from 7 GRPO with incorrect price in the row of the invoice. How can i do to change the price? I can not do a credit memo cause all goods have been sold, so i don't have

  • Itunes is saying i need quicktime that is already installed

    Can someone help??? I am not very technical...safari went missing from my dock today and I did everything to get it back but couldn't...so I reinstalled the disks that came with the mac and got safari back but now my itunes wont open and it says I ne

  • Not able to create a Volume Group in the oracle VM server installation

    Hi, I am installing Oracle VM server. In the installtion ( Partition time ), i click on create custom layout and i want to create a / partition as a logical volumn under volume group. But there is no option to create a Volume group actually. So can a

  • I selected iTunes as default player and now I can't hear anything playing

    I've tried everything in the help menu and just can't get anything to re-set so that I can hear what it is that I am choosing to play. This is really frustrating. I would go back to Musicmatch, it seems like when I selected iTunes as the default play

  • Performance Issue in modifying a ITAB

    Hi SDNs., performance issue in modifying a internal table : code : *-Modify LT_DOC with Object list number(OBKNR) from SER03   LOOP AT LT_SER03_HASH INTO LW_SER03.     IF ( LW_SER03-OBKNR IS NOT INITIAL ).       READ TABLE LT_DOC INTO LW_DOC WITH KEY