/// <summary> /// Create ribbon /// </summary> /// <returns></returns> protected override IRibbonExtensibility CreateRibbonExtensibilityObject() { var app = this.GetHostItem<Microsoft.Office.Interop.Word.Application>(typeof(Microsoft.Office.Interop.Word.Application), "Application"); var ci = new CultureInfo((int)app.Language); Thread.CurrentThread.CurrentUICulture = ci; MsWordVersion = OfficeHelper.GetMsWordVersion(app.Version); SectionManager.SetSection(MsWordVersion); return new SalmaRibbon(); }
public void MarkupLunguageForDifferentMsWordVersions(MsWordVersion msWordVersion, ShapeMarkupLanguage shapeMarkupLanguage) { Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); doc.CompatibilityOptions.OptimizeFor(msWordVersion); Shape image = builder.InsertImage(ImageDir + "dotnet-logo.png"); // Loop through all single shapes inside document. foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true)) { Assert.AreEqual(shapeMarkupLanguage, shape.MarkupLanguage); } }
/// <summary> /// Get icon. /// </summary> /// <param name="icon"> /// Word Icon. /// </param> /// <returns> /// msoid. /// </returns> public static string GetImageMso(Icons icon, MsWordVersion version) { return SectionManager.Section.Images[icon.ToString()].Value; }
/// <summary> /// Get icon. /// </summary> /// <param name="icon"> /// Word Icon. /// </param> /// <returns> /// msoid. /// </returns> public static string GetImageMso(Icons icon, MsWordVersion version) { return(SectionManager.Section.Images[icon.ToString()].Value); }
public static void SetSection(MsWordVersion MsWordVersion) { Section = (MsWordVersion == MsWordVersion.MsWord2007 ? (WordSection)ConfigurationManager.GetSection(Properties.Resources.Word2007Section) : (WordSection)ConfigurationManager.GetSection(Properties.Resources.WordSection)); }
public void MarkupLunguageForDifferentMsWordVersions(MsWordVersion msWordVersion, ShapeMarkupLanguage shapeMarkupLanguage) { Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); doc.CompatibilityOptions.OptimizeFor(msWordVersion); Shape image = builder.InsertImage(MyDir + @"dotnet-logo.png"); // Loop through all single shapes inside document. foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true)) { Assert.AreEqual(shapeMarkupLanguage, shape.MarkupLanguage); } }