Skip to content

Instantly share code, notes, and snippets.

View chenxizhang's full-sized avatar
🎯
Focusing

Ares Chen chenxizhang

🎯
Focusing
View GitHub Profile
@chenxizhang
chenxizhang / GetFileAsync.POWERPOINT.yaml
Last active March 31, 2019 03:16
Create a new snippet from a blank template.
name: GetFileAsync
description: Create a new snippet from a blank template.
host: POWERPOINT
api_set: {}
script:
content: |
(function(r) {
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = r();
} else if (typeof define === "function" && define.amd) {
@chenxizhang
chenxizhang / TableOperation.EXCEL.yaml
Last active March 13, 2019 09:49
Create a new snippet from a blank template.
name: TableOperation
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: >
$("#createtable").click(() => tryCatch(createtable));
$("#filtertable").click(() => tryCatch(filtertable));
@chenxizhang
chenxizhang / YouImage.EXCEL.yaml
Last active March 13, 2019 09:49
Create a new snippet from a blank template.
name: YouImage
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
var dec2hex = function(d) {
if (d > 15) {
@chenxizhang
chenxizhang / micrsoftgraphsdkwithadal.cs
Created March 15, 2018 06:45
Connect to Microsoft Graph use ADAL & Microsoft Graph SDK
using Microsoft.Graph;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System;
using System.Threading.Tasks;
namespace MicrosoftGraphSampleUseADAL
{
//这个代码演示了如何使用ADAL和Microsoft Graph库来实现访问,并且分别实现了国际版和国内版
//作者:陈希章
@chenxizhang
chenxizhang / SUMMARY.md
Created December 16, 2017 07:08
access azure cognitive service emotion api via image url
name: GetAPIValues
description: ''
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@chenxizhang
chenxizhang / Report generator vba.vb
Last active February 15, 2019 11:58
Report Generator VBA Sample
Sub ReportGeneration()
' 这个方法用来生成销售数据,并且基于这些数据生成一个柱状图表
' 作者:陈希章
Dim sh As Worksheet
Set sh = ThisWorkbook.Worksheets.Add
sh.Activate
Dim rng As Range
@chenxizhang
chenxizhang / Report generator vsto vb.vb
Created November 24, 2017 23:50
Report generator VSTO VB Sample
Imports Microsoft.Office.Interop.Excel
Imports Microsoft.Office.Tools.Ribbon
Public Class Ribbon1
Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs) Handles Button1.Click
@chenxizhang
chenxizhang / report generator vsto csharp.cs
Created November 24, 2017 23:49
Report generator VSTO Csharp Sample
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;
using Microsoft.Office.Interop.Excel;
namespace ExcelAddIn3
{
public partial class Ribbon1
@chenxizhang
chenxizhang / MicrosoftGraph-ConsoleApplication.cs
Created November 13, 2017 13:39
这个范例代码演示了如何在Console Application中完整地实现Azure AD 2.0身份认证,并且保存身份。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Identity.Client;
using Microsoft.Graph;
using System.Net.Http;
/// <summary>