Post in a blog in SharePoint can be directly published in Word

Source: Internet
Author: User

Msdn:Http://social.microsoft.com/Forums/zh-CN/partnercndevsharepoint/thread/9d9a6bc4-2dfe-4d98-9c3f-fe33dcd6d18d

Hey, everybody!

There is"Launch blog program to post"Button can directly open the word post! If it is opened for the first time, the following registration will pop up!

View the source file. It calls function newblogpostonclient (strproviderid, strblogurl, strblogname) in init. js );

Protected void btntestblog_click (Object sender, eventargs e) {// This sentence is copied from SharePoint // javascript: newblogpostonclient (% messages % 27, % 20% 27 http: // jianghao: 9000/personal/hao_jiang/blog % 27, % 20% 27e861d78e-6e8d-4afb-93b4-89416bc4c071 # e819785b-954f-41a9-9bbf-e0f6df91b76a ') "/** first parameter: fixed parameter * second parameter: blog address * third parameter: blog ID + "#" + guid * // dwn ("str1 =====" + server. urldecode ("% 27"); // dwn ("str2 ======" + server. htmldecode ("% 27"); // dwn (""); Is response. write (""); Using (spsite site = new spsite ("http: // jianghao: 9000/personal/hao_jiang") {using (spweb rootweb = site. rootweb) {spweb web = rootweb. webs ["blog"]; dwn ("ID =" + web. ID); dwn ("url =" + web. URL); dwn ("serverrelativeurl =" + web. serverrelativeurl); dwn ("currencylocaleid =" + web. currencylocaleid); dwn ("parentwebid =" + web. parentwebid); string urlstr = "javascript: newblogpostonclient ('18faf3ff-2cdd-4f17-9b7c-b11d0127f405 ',"; urlstr + = "'" + web. URL + "',"; urlstr + = "'" + web. ID + "#2cefe993-04d1-4e4e-80b2-04c47bcbbba6" + "')"; // There is an open Word hladmlnk5.navigateurl = urlstr;/** the problem now is that word can open post and publish! That is, if the guid behind the # sign that you splice is different from the * In Sharepoint, the registration window will pop up each time, and the SharePoint will only pop up once! * What does the guid after # sign mean? How can I obtain it? * Thank you * // * system. collections. hashtable ht = web. allproperties; foreach (VAR Item1 in HT. keys) {// dwn (Item1 + "===>" + HT [Item1]);} Microsoft. sharepoint. utilities. sppropertybag bag = web. properties; foreach (VAR item in bag. keys) {// dwn (item + "==>" + bag [item. tostring ()]);} **/}

 



 

before you raise this question! Under my blog sites on different SharePoint sites, " launch blog program to post " copy the called script to notepad!

I found that the guid behind the # symbol is different!

click SharePoint " launch blog program to post ", the registration box appears only once! But clicking it later will not pop up! I think whether the guid after # is the record is the first pop-up registration box!

In Your Code , as long as the guid after # is not the same as the guid after # In Sharepoint, although this is the first time, the registration box will pop up later!

I copied the guid behind # In Sharepoint to the guid behind # In my code, the effect is the same as that in SharePoint! However, the Program is dynamic

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.