diff --git a/GreenshotOfficePlugin/OfficeConfiguration.cs b/GreenshotOfficePlugin/OfficeConfiguration.cs index 0a7220f43..d1f9a11f9 100644 --- a/GreenshotOfficePlugin/OfficeConfiguration.cs +++ b/GreenshotOfficePlugin/OfficeConfiguration.cs @@ -40,5 +40,7 @@ namespace GreenshotOfficePlugin { public string EmailBCC; [IniProperty("OutlookAllowExportInMeetings", Description = "Allow export in meeting items", DefaultValue = "False")] public bool OutlookAllowExportInMeetings; + [IniProperty("WordLockAspectRatio", Description = "For Word: Lock the aspect ratio of the image", DefaultValue = "True")] + public bool WordLockAspectRatio; } } \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeExport/WordExporter.cs b/GreenshotOfficePlugin/OfficeExport/WordExporter.cs index fef43baee..1bf25b80e 100644 --- a/GreenshotOfficePlugin/OfficeExport/WordExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/WordExporter.cs @@ -23,11 +23,14 @@ using System.Collections.Generic; using System.Text; using Greenshot.Interop; +using GreenshotOfficePlugin; +using Greenshot.IniFile; namespace Greenshot.Interop.Office { public class WordExporter { private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(WordExporter)); private static string version = null; + private static OfficeConfiguration config = IniConfig.GetIniSection(); public static bool isAfter2003() { if (version != null) { @@ -106,6 +109,10 @@ namespace Greenshot.Interop.Office { private static IInlineShape AddPictureToSelection(ISelection selection, string tmpFile) { IInlineShape shape = selection.InlineShapes.AddPicture(tmpFile, false, true, Type.Missing); + // Lock aspect ratio + if (config.WordLockAspectRatio) { + shape.LockAspectRatio = MsoTriState.msoTrue; + } selection.InsertAfter("\r\n"); return shape; } diff --git a/GreenshotOfficePlugin/OfficeInterop/WordInterop.cs b/GreenshotOfficePlugin/OfficeInterop/WordInterop.cs index cfa3b3e11..ee0d2e560 100644 --- a/GreenshotOfficePlugin/OfficeInterop/WordInterop.cs +++ b/GreenshotOfficePlugin/OfficeInterop/WordInterop.cs @@ -101,6 +101,10 @@ namespace Greenshot.Interop.Office { /// public interface IInlineShape : Common { IHyperlink Hyperlink { get; } + MsoTriState LockAspectRatio { + get; + set; + } } ///