mirror of
https://github.com/greenshot/greenshot.git
synced 2025-03-12 05:25:25 -07:00
Removed hand written office interfaces in favor of PIA, which was not possible to use until we finally upgraded to a newer .NET Framework
This commit is contained in:
parent
d8b58b1538
commit
3af6a8ae0d
src
Greenshot.Addon.Box
Greenshot.Addon.Confluence
Greenshot.Addon.Dropbox
Greenshot.Addon.ExternalCommand
Greenshot.Addon.Flickr
Greenshot.Addon.GooglePhotos
Greenshot.Addon.Imgur
Greenshot.Addon.Jira
Greenshot.Addon.LegacyEditor
Greenshot.Addon.Lutim
Greenshot.Addon.OCR
Greenshot.Addon.Office
Destinations
Greenshot.Addon.Office.csprojIOfficeConfiguration.csOfficeExport
OfficeInterop
EmailFormat.csHierarchyScope.csIAppointmentItem.csIAttachment.csIAttachments.csIComCollection.csIComCommon.csICommonExplorer.csIContactItem.csIDocuments.csIExcelApplication.csIExplorer.csIExplorers.csIFolder.csIHyperlink.csIHyperlinks.csIInlineShape.csIInlineShapes.csIInspector.csIInspectors.csIItem.csIItems.csIMailItem.csINameSpace.csIOneNoteApplication.csIOutlookApplication.csIPane.csIPictures.csIPropertyAccessor.csIRecipient.csISelection.csIWordApplication.csIWordDocument.csIWordView.csIWordWindow.csIWorkbook.csIWorkbooks.csIWorksheet.csIWorksheets.csIZoom.csMsoTriState.csNewPageStyle.csOfficeCommunicator.csOlAttachmentType.csOlBodyFormat.csOlDefaultFolders.csOlEditorType.csOlInspectorClose.csOlItemType.csOlObjectClass.csOlReoccurenceState.csOlSensitivity.csOlWindowState.csOneNoteNotebook.csOneNotePage.csOneNoteSection.csOutlookUtils.csPageInfo.csPowerpointInterop.csPropTag.csSpecialLocation.csWdUnits.csXMLSchema.cs
ViewModels
packages.configGreenshot.Addon.OneDrive
Greenshot.Addon.Photobucket
Greenshot.Addon.Tfs
Greenshot.Addon.Win10
Greenshot.Addons
Greenshot.Core
Greenshot.Gfx
Greenshot.PerformanceTests
@ -157,7 +157,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -163,7 +163,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Windows" />
|
||||
@ -236,13 +235,13 @@ copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Green
|
||||
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
|
||||
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\packages\Fody.3.1.4\build\Fody.targets" Condition="Exists('..\packages\Fody.3.1.4\build\Fody.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Fody.3.1.4\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.1.4\build\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" />
|
||||
<Import Project="..\packages\Fody.3.1.4\build\Fody.targets" Condition="Exists('..\packages\Fody.3.1.4\build\Fody.targets')" />
|
||||
</Project>
|
@ -154,7 +154,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -151,7 +151,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -163,7 +163,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -149,7 +149,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -177,7 +177,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -181,7 +181,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Windows" />
|
||||
@ -307,13 +306,13 @@ copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuratio
|
||||
<DebugType>None</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\packages\Fody.3.1.4\build\Fody.targets" Condition="Exists('..\packages\Fody.3.1.4\build\Fody.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Fody.3.1.4\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.1.4\build\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" />
|
||||
<Import Project="..\packages\Fody.3.1.4\build\Fody.targets" Condition="Exists('..\packages\Fody.3.1.4\build\Fody.targets')" />
|
||||
</Project>
|
@ -141,7 +141,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -166,7 +166,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -148,7 +148,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -31,7 +31,6 @@ using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dapplo.Log;
|
||||
using Greenshot.Addon.Office.OfficeExport;
|
||||
using Greenshot.Addon.Office.OfficeInterop;
|
||||
using Greenshot.Addons;
|
||||
using Greenshot.Addons.Components;
|
||||
using Greenshot.Addons.Core;
|
||||
@ -143,7 +142,8 @@ namespace Greenshot.Addon.Office.Destinations
|
||||
Log.Error().WriteLine(ex);
|
||||
}
|
||||
}
|
||||
return exportInformation;
|
||||
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||
return exportInformation;
|
||||
}
|
||||
}
|
||||
}
|
@ -30,12 +30,12 @@ using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Dapplo.Log;
|
||||
using Greenshot.Addon.Office.OfficeExport;
|
||||
using Greenshot.Addon.Office.OfficeInterop;
|
||||
using Greenshot.Addons;
|
||||
using Greenshot.Addons.Components;
|
||||
using Greenshot.Addons.Core;
|
||||
using Greenshot.Addons.Interfaces;
|
||||
using Greenshot.Addons.Interfaces.Plugin;
|
||||
using Microsoft.Office.Interop.Outlook;
|
||||
|
||||
#endregion
|
||||
|
||||
@ -121,7 +121,7 @@ namespace Greenshot.Addon.Office.Destinations
|
||||
|
||||
public override IEnumerable<IDestination> DynamicDestinations()
|
||||
{
|
||||
var inspectorCaptions = OutlookEmailExporter.RetrievePossibleTargets();
|
||||
var inspectorCaptions = OutlookExporter.RetrievePossibleTargets();
|
||||
if (inspectorCaptions == null)
|
||||
{
|
||||
yield break;
|
||||
@ -169,14 +169,14 @@ namespace Greenshot.Addon.Office.Destinations
|
||||
|
||||
if (_outlookInspectorCaption != null)
|
||||
{
|
||||
OutlookEmailExporter.ExportToInspector(_outlookInspectorCaption, tmpFile, attachmentName);
|
||||
OutlookExporter.ExportToInspector(_outlookInspectorCaption, tmpFile, attachmentName);
|
||||
exportInformation.ExportMade = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!manuallyInitiated)
|
||||
{
|
||||
var inspectorCaptions = OutlookEmailExporter.RetrievePossibleTargets();
|
||||
var inspectorCaptions = OutlookExporter.RetrievePossibleTargets();
|
||||
if (inspectorCaptions != null && inspectorCaptions.Count > 0)
|
||||
{
|
||||
var destinations = new List<IDestination>
|
||||
@ -193,7 +193,7 @@ namespace Greenshot.Addon.Office.Destinations
|
||||
}
|
||||
else
|
||||
{
|
||||
exportInformation.ExportMade = OutlookEmailExporter.ExportToOutlook(_officeConfiguration.OutlookEmailFormat, tmpFile,
|
||||
exportInformation.ExportMade = OutlookExporter.ExportToOutlook(_officeConfiguration.OutlookEmailFormat, tmpFile,
|
||||
FilenameHelper.FillPattern(_officeConfiguration.EmailSubjectPattern, captureDetails, false), attachmentName, _officeConfiguration.EmailTo, _officeConfiguration.EmailCC,
|
||||
_officeConfiguration.EmailBCC, null);
|
||||
}
|
||||
|
@ -124,8 +124,8 @@ namespace Greenshot.Addon.Office.Destinations
|
||||
{
|
||||
if (!manuallyInitiated)
|
||||
{
|
||||
var presentations = PowerpointExporter.GetPowerpointPresentations();
|
||||
if (presentations != null && presentations.Count > 0)
|
||||
var presentations = PowerpointExporter.GetPowerpointPresentations().ToList();
|
||||
if (presentations.Count > 0)
|
||||
{
|
||||
var destinations = new List<IDestination>
|
||||
{
|
||||
|
@ -126,8 +126,8 @@ namespace Greenshot.Addon.Office.Destinations
|
||||
{
|
||||
if (!manuallyInitiated)
|
||||
{
|
||||
var documents = WordExporter.GetWordDocuments();
|
||||
if (documents != null && documents.Count > 0)
|
||||
var documents = WordExporter.GetWordDocuments().ToList();
|
||||
if (documents.Count > 0)
|
||||
{
|
||||
var destinations = new List<IDestination>
|
||||
{
|
||||
|
@ -121,6 +121,22 @@
|
||||
<Reference Include="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Office.Interop.Outlook.15.0.4797.1003\lib\net20\Microsoft.Office.Interop.Outlook.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Office.Interop.PowerPoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Office.Interop.PowerPoint.15.0.4420.1017\lib\net20\Microsoft.Office.Interop.PowerPoint.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Office.Interop.Word, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Office.Interop.Word.15.0.4797.1003\lib\net20\Microsoft.Office.Interop.Word.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
@ -141,7 +157,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
@ -160,63 +175,8 @@
|
||||
<Compile Include="Destinations\WordDestination.cs" />
|
||||
<Compile Include="IOfficeLanguage.cs" />
|
||||
<Compile Include="IOfficeConfiguration.cs" />
|
||||
<Compile Include="OfficeInterop\IAppointmentItem.cs" />
|
||||
<Compile Include="OfficeInterop\EmailFormats.cs" />
|
||||
<Compile Include="OfficeInterop\HierarchyScope.cs" />
|
||||
<Compile Include="OfficeInterop\IAttachment.cs" />
|
||||
<Compile Include="OfficeInterop\IAttachments.cs" />
|
||||
<Compile Include="OfficeInterop\IComCommon.cs" />
|
||||
<Compile Include="OfficeInterop\ICommonExplorer.cs" />
|
||||
<Compile Include="OfficeInterop\IContactItem.cs" />
|
||||
<Compile Include="OfficeInterop\IDocuments.cs" />
|
||||
<Compile Include="OfficeInterop\IExplorer.cs" />
|
||||
<Compile Include="OfficeInterop\IExplorers.cs" />
|
||||
<Compile Include="OfficeInterop\IFolder.cs" />
|
||||
<Compile Include="OfficeInterop\IHyperlink.cs" />
|
||||
<Compile Include="OfficeInterop\IHyperlinks.cs" />
|
||||
<Compile Include="OfficeInterop\IInlineShape.cs" />
|
||||
<Compile Include="OfficeInterop\IInlineShapes.cs" />
|
||||
<Compile Include="OfficeInterop\IInspector.cs" />
|
||||
<Compile Include="OfficeInterop\IInspectors.cs" />
|
||||
<Compile Include="OfficeInterop\IItem.cs" />
|
||||
<Compile Include="OfficeInterop\IItems.cs" />
|
||||
<Compile Include="OfficeInterop\INameSpace.cs" />
|
||||
<Compile Include="OfficeInterop\IOneNoteApplication.cs" />
|
||||
<Compile Include="OfficeInterop\IOutlookApplication.cs" />
|
||||
<Compile Include="OfficeInterop\IPane.cs" />
|
||||
<Compile Include="OfficeInterop\IPictures.cs" />
|
||||
<Compile Include="OfficeInterop\IPropertyAccessor.cs" />
|
||||
<Compile Include="OfficeInterop\IRecipient.cs" />
|
||||
<Compile Include="OfficeInterop\ISelection.cs" />
|
||||
<Compile Include="OfficeInterop\IWordDocument.cs" />
|
||||
<Compile Include="OfficeInterop\IWordView.cs" />
|
||||
<Compile Include="OfficeInterop\IWordWindow.cs" />
|
||||
<Compile Include="OfficeInterop\IWorkbook.cs" />
|
||||
<Compile Include="OfficeInterop\IWorkbooks.cs" />
|
||||
<Compile Include="OfficeInterop\IWorksheet.cs" />
|
||||
<Compile Include="OfficeInterop\IWorksheets.cs" />
|
||||
<Compile Include="OfficeInterop\IZoom.cs" />
|
||||
<Compile Include="OfficeInterop\IMailItem.cs" />
|
||||
<Compile Include="OfficeInterop\MsoScaleFrom.cs" />
|
||||
<Compile Include="OfficeInterop\MsoTriState.cs" />
|
||||
<Compile Include="OfficeInterop\NewPageStyle.cs" />
|
||||
<Compile Include="OfficeInterop\EmailFormat.cs" />
|
||||
<Compile Include="OfficeInterop\OfficeVersions.cs" />
|
||||
<Compile Include="OfficeInterop\OlAttachmentType.cs" />
|
||||
<Compile Include="OfficeInterop\OlBodyFormat.cs" />
|
||||
<Compile Include="OfficeInterop\OlDefaultFolders.cs" />
|
||||
<Compile Include="OfficeInterop\OlEditorType.cs" />
|
||||
<Compile Include="OfficeInterop\OlInspectorClose.cs" />
|
||||
<Compile Include="OfficeInterop\OlItemType.cs" />
|
||||
<Compile Include="OfficeInterop\OlObjectClass.cs" />
|
||||
<Compile Include="OfficeInterop\OlReoccurenceState.cs" />
|
||||
<Compile Include="OfficeInterop\OlSensitivity.cs" />
|
||||
<Compile Include="OfficeInterop\OlWindowState.cs" />
|
||||
<Compile Include="OfficeInterop\OneNoteNotebook.cs" />
|
||||
<Compile Include="OfficeInterop\OneNoteSection.cs" />
|
||||
<Compile Include="OfficeInterop\PageInfo.cs" />
|
||||
<Compile Include="OfficeInterop\SpecialLocation.cs" />
|
||||
<Compile Include="OfficeInterop\WdUnits.cs" />
|
||||
<Compile Include="OfficeInterop\XMLSchema.cs" />
|
||||
<Compile Include="OfficeAddonModule.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="OfficeExport\ExcelExporter.cs" />
|
||||
@ -224,13 +184,6 @@
|
||||
<Compile Include="OfficeExport\OutlookEmailExporter.cs" />
|
||||
<Compile Include="OfficeExport\PowerpointExporter.cs" />
|
||||
<Compile Include="OfficeExport\WordExporter.cs" />
|
||||
<Compile Include="OfficeInterop\IExcelApplication.cs" />
|
||||
<Compile Include="OfficeInterop\IComCollection.cs" />
|
||||
<Compile Include="OfficeInterop\OneNotePage.cs" />
|
||||
<Compile Include="OfficeInterop\PropTag.cs" />
|
||||
<Compile Include="OfficeInterop\OutlookUtils.cs" />
|
||||
<Compile Include="OfficeInterop\PowerpointInterop.cs" />
|
||||
<Compile Include="OfficeInterop\IWordApplication.cs" />
|
||||
<Compile Include="ViewModels\OfficeConfigViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -258,6 +211,26 @@
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="Microsoft.Office.Core">
|
||||
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>8</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="Microsoft.Office.Interop.OneNote">
|
||||
<Guid>{0EA692EE-BB50-4E3C-AEF0-356D91732725}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>1</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
|
||||
@ -266,13 +239,13 @@ copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Green
|
||||
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
|
||||
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\packages\Fody.3.1.4\build\Fody.targets" Condition="Exists('..\packages\Fody.3.1.4\build\Fody.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Fody.3.1.4\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.1.4\build\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" />
|
||||
<Import Project="..\packages\Fody.3.1.4\build\Fody.targets" Condition="Exists('..\packages\Fody.3.1.4\build\Fody.targets')" />
|
||||
</Project>
|
@ -27,6 +27,7 @@ using System.ComponentModel;
|
||||
using Dapplo.Ini;
|
||||
using Dapplo.InterfaceImpl.Extensions;
|
||||
using Greenshot.Addon.Office.OfficeInterop;
|
||||
using Microsoft.Office.Interop.PowerPoint;
|
||||
|
||||
#endregion
|
||||
|
||||
@ -40,8 +41,8 @@ namespace Greenshot.Addon.Office
|
||||
public interface IOfficeConfiguration : IIniSection, ITransactionalProperties, INotifyPropertyChanged
|
||||
{
|
||||
[Description("Default type for emails. (Text, Html)")]
|
||||
[DefaultValue(EmailFormats.Html)]
|
||||
EmailFormats OutlookEmailFormat { get; set; }
|
||||
[DefaultValue(EmailFormat.Html)]
|
||||
EmailFormat OutlookEmailFormat { get; set; }
|
||||
|
||||
[Description("Email subject pattern, works like the OutputFileFilenamePattern")]
|
||||
[DefaultValue("${title}")]
|
||||
@ -72,7 +73,7 @@ namespace Greenshot.Addon.Office
|
||||
bool PowerpointLockAspectRatio { get; set; }
|
||||
|
||||
[Description("For Powerpoint: Slide layout, changing this to a wrong value will fallback on ppLayoutBlank!!")]
|
||||
[DefaultValue(PPSlideLayout.ppLayoutPictureWithCaption)]
|
||||
PPSlideLayout PowerpointSlideLayout { get; set; }
|
||||
[DefaultValue(PpSlideLayout.ppLayoutPictureWithCaption)]
|
||||
PpSlideLayout PowerpointSlideLayout { get; set; }
|
||||
}
|
||||
}
|
@ -26,186 +26,208 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dapplo.Log;
|
||||
using Dapplo.Windows.Com;
|
||||
using Dapplo.Windows.Desktop;
|
||||
using Greenshot.Addon.Office.OfficeInterop;
|
||||
using Microsoft.Office.Core;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using Version = System.Version;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeExport
|
||||
{
|
||||
public static class ExcelExporter
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static Version _excelVersion;
|
||||
/// <summary>
|
||||
/// Excel exporter
|
||||
/// </summary>
|
||||
public static class ExcelExporter
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static Version _excelVersion;
|
||||
|
||||
/// <summary>
|
||||
/// Get all currently opened workbooks
|
||||
/// </summary>
|
||||
/// <returns>List of string with names of the workbooks</returns>
|
||||
public static List<string> GetWorkbooks()
|
||||
{
|
||||
var currentWorkbooks = new List<string>();
|
||||
using (var excelApplication = GetExcelApplication())
|
||||
{
|
||||
if (excelApplication == null)
|
||||
{
|
||||
return currentWorkbooks;
|
||||
}
|
||||
using (var workbooks = excelApplication.Workbooks)
|
||||
{
|
||||
for (var i = 1; i <= workbooks.Count; i++)
|
||||
{
|
||||
using (var workbook = workbooks[i])
|
||||
{
|
||||
if (workbook != null)
|
||||
{
|
||||
currentWorkbooks.Add(workbook.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
currentWorkbooks.Sort();
|
||||
return currentWorkbooks;
|
||||
}
|
||||
/// <summary>
|
||||
/// Call this to get the running Excel application, returns null if there isn't any.
|
||||
/// </summary>
|
||||
/// <returns>ComDisposable for Excel.Application or null</returns>
|
||||
private static IDisposableCom<Application> GetExcelApplication()
|
||||
{
|
||||
IDisposableCom<Application> excelApplication;
|
||||
try
|
||||
{
|
||||
excelApplication = DisposableCom.Create((Application)Marshal.GetActiveObject("Excel.Application"));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore, probably no excel running
|
||||
return null;
|
||||
}
|
||||
if ((excelApplication != null) && (excelApplication.ComObject != null))
|
||||
{
|
||||
InitializeVariables(excelApplication);
|
||||
}
|
||||
return excelApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Insert image from supplied tmp file into the give excel workbook
|
||||
/// </summary>
|
||||
/// <param name="workbookName"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
public static void InsertIntoExistingWorkbook(string workbookName, string tmpFile, Size imageSize)
|
||||
{
|
||||
using (var excelApplication = GetExcelApplication())
|
||||
{
|
||||
if (excelApplication == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
using (var workbooks = excelApplication.Workbooks)
|
||||
{
|
||||
for (var i = 1; i <= workbooks.Count; i++)
|
||||
{
|
||||
using (var workbook = workbooks[i])
|
||||
{
|
||||
if (workbook != null && workbook.Name.StartsWith(workbookName))
|
||||
{
|
||||
InsertIntoExistingWorkbook(workbook, tmpFile, imageSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var hWnd = excelApplication.Hwnd;
|
||||
if (hWnd > 0)
|
||||
{
|
||||
// TODO: Await
|
||||
InteropWindowFactory.CreateFor(new IntPtr(hWnd)).ToForegroundAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Call this to get the running Excel application, or create a new instance
|
||||
/// </summary>
|
||||
/// <returns>ComDisposable for Excel.Application</returns>
|
||||
private static IDisposableCom<Application> GetOrCreateExcelApplication()
|
||||
{
|
||||
IDisposableCom<Application> excelApplication = GetExcelApplication();
|
||||
if (excelApplication == null)
|
||||
{
|
||||
excelApplication = DisposableCom.Create(new Application());
|
||||
}
|
||||
InitializeVariables(excelApplication);
|
||||
return excelApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Insert a file into an already created workbook
|
||||
/// </summary>
|
||||
/// <param name="workbook"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
private static void InsertIntoExistingWorkbook(IWorkbook workbook, string tmpFile, Size imageSize)
|
||||
{
|
||||
var workSheet = workbook.ActiveSheet;
|
||||
if (workSheet == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
using (var shapes = workSheet.Shapes)
|
||||
{
|
||||
if (shapes != null)
|
||||
{
|
||||
using (var shape = shapes.AddPicture(tmpFile, MsoTriState.msoFalse, MsoTriState.msoTrue, 0, 0, imageSize.Width, imageSize.Height))
|
||||
{
|
||||
if (shape != null)
|
||||
{
|
||||
shape.Top = 40;
|
||||
shape.Left = 40;
|
||||
shape.LockAspectRatio = MsoTriState.msoTrue;
|
||||
shape.ScaleHeight(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromTopLeft);
|
||||
shape.ScaleWidth(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromTopLeft);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Get all currently opened workbooks
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable with names of the workbooks</returns>
|
||||
public static IEnumerable<string> GetWorkbooks()
|
||||
{
|
||||
using (var excelApplication = GetExcelApplication())
|
||||
{
|
||||
if ((excelApplication == null) || (excelApplication.ComObject == null))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
using (var workbooks = DisposableCom.Create(excelApplication.ComObject.Workbooks))
|
||||
{
|
||||
for (int i = 1; i <= workbooks.ComObject.Count; i++)
|
||||
{
|
||||
using (var workbook = DisposableCom.Create(workbooks.ComObject[i]))
|
||||
{
|
||||
if (workbook != null)
|
||||
{
|
||||
yield return workbook.ComObject.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add an image-file to a newly created workbook
|
||||
/// </summary>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
public static void InsertIntoNewWorkbook(string tmpFile, Size imageSize)
|
||||
{
|
||||
using (var excelApplication = GetOrCreateExcelApplication())
|
||||
{
|
||||
if (excelApplication != null)
|
||||
{
|
||||
excelApplication.Visible = true;
|
||||
object template = Missing.Value;
|
||||
using (var workbooks = excelApplication.Workbooks)
|
||||
{
|
||||
var workbook = workbooks.Add(template);
|
||||
InsertIntoExistingWorkbook(workbook, tmpFile, imageSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Initialize static excel variables like version and currentuser
|
||||
/// </summary>
|
||||
/// <param name="excelApplication"></param>
|
||||
private static void InitializeVariables(IDisposableCom<Application> excelApplication)
|
||||
{
|
||||
if ((excelApplication == null) || (excelApplication.ComObject == null) || (_excelVersion != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!Version.TryParse(excelApplication.ComObject.Version, out _excelVersion))
|
||||
{
|
||||
Log.Warn().WriteLine("Assuming Excel version 1997.");
|
||||
_excelVersion = new Version((int)OfficeVersions.Office97, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Insert image from supplied tmp file into the give excel workbook
|
||||
/// </summary>
|
||||
/// <param name="workbookName"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
public static void InsertIntoExistingWorkbook(string workbookName, string tmpFile, Size imageSize)
|
||||
{
|
||||
using (var excelApplication = GetExcelApplication())
|
||||
{
|
||||
if ((excelApplication == null) || (excelApplication.ComObject == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
using (var workbooks = DisposableCom.Create(excelApplication.ComObject.Workbooks))
|
||||
{
|
||||
for (int i = 1; i <= workbooks.ComObject.Count; i++)
|
||||
{
|
||||
using (var workbook = DisposableCom.Create((_Workbook)workbooks.ComObject[i]))
|
||||
{
|
||||
if ((workbook != null) && workbook.ComObject.Name.StartsWith(workbookName))
|
||||
{
|
||||
InsertIntoExistingWorkbook(workbook, tmpFile, imageSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this to get the running Excel application, returns null if there isn't any.
|
||||
/// </summary>
|
||||
/// <returns>IExcelApplication or null</returns>
|
||||
private static IExcelApplication GetExcelApplication()
|
||||
{
|
||||
var excelApplication = ComWrapper.GetInstance<IExcelApplication>();
|
||||
InitializeVariables(excelApplication);
|
||||
return excelApplication;
|
||||
}
|
||||
/// <summary>
|
||||
/// Insert a file into an already created workbook
|
||||
/// </summary>
|
||||
/// <param name="workbook"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
private static void InsertIntoExistingWorkbook(IDisposableCom<_Workbook> workbook, string tmpFile, Size imageSize)
|
||||
{
|
||||
using (var workSheet = DisposableCom.Create(workbook.ComObject.ActiveSheet as Worksheet))
|
||||
{
|
||||
if (workSheet == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
using (var shapes = DisposableCom.Create(workSheet.ComObject.Shapes))
|
||||
{
|
||||
if (shapes == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this to get the running Excel application, or create a new instance
|
||||
/// </summary>
|
||||
/// <returns>IExcelApplication</returns>
|
||||
private static IExcelApplication GetOrCreateExcelApplication()
|
||||
{
|
||||
var excelApplication = ComWrapper.GetOrCreateInstance<IExcelApplication>();
|
||||
InitializeVariables(excelApplication);
|
||||
return excelApplication;
|
||||
}
|
||||
using (var shape = DisposableCom.Create(shapes.ComObject.AddPicture(tmpFile, MsoTriState.msoFalse, MsoTriState.msoTrue, 0, 0, imageSize.Width, imageSize.Height)))
|
||||
{
|
||||
if (shape == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
shape.ComObject.Top = 40;
|
||||
shape.ComObject.Left = 40;
|
||||
shape.ComObject.LockAspectRatio = MsoTriState.msoTrue;
|
||||
shape.ComObject.ScaleHeight(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromTopLeft);
|
||||
shape.ComObject.ScaleWidth(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromTopLeft);
|
||||
workbook.ComObject.Activate();
|
||||
using (var application = DisposableCom.Create(workbook.ComObject.Application))
|
||||
{
|
||||
var excelWindow = InteropWindowFactory.CreateFor((IntPtr) application.ComObject.Hwnd);
|
||||
excelWindow.ToForegroundAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add an image-file to a newly created workbook
|
||||
/// </summary>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
public static void InsertIntoNewWorkbook(string tmpFile, Size imageSize)
|
||||
{
|
||||
using (var excelApplication = GetOrCreateExcelApplication())
|
||||
{
|
||||
if (excelApplication == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
excelApplication.ComObject.Visible = true;
|
||||
using (var workbooks = DisposableCom.Create(excelApplication.ComObject.Workbooks))
|
||||
{
|
||||
using (var workbook = DisposableCom.Create((_Workbook)workbooks.ComObject.Add()))
|
||||
{
|
||||
InsertIntoExistingWorkbook(workbook, tmpFile, imageSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize static outlook variables like version and currentuser
|
||||
/// </summary>
|
||||
/// <param name="excelApplication"></param>
|
||||
private static void InitializeVariables(IExcelApplication excelApplication)
|
||||
{
|
||||
if (excelApplication == null || _excelVersion != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_excelVersion = new Version(excelApplication.Version);
|
||||
Log.Info().WriteLine("Using Excel {0}", _excelVersion);
|
||||
}
|
||||
catch (Exception exVersion)
|
||||
{
|
||||
Log.Error().WriteLine(exVersion);
|
||||
Log.Warn().WriteLine("Assuming Excel version 1997.");
|
||||
_excelVersion = new Version((int) OfficeVersions.Office97, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -26,240 +26,350 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml;
|
||||
using Dapplo.Log;
|
||||
using Dapplo.Windows.Com;
|
||||
using Greenshot.Addon.Office.OfficeInterop;
|
||||
using Greenshot.Addons.Core;
|
||||
using Greenshot.Addons.Core.Enums;
|
||||
using Greenshot.Addons.Interfaces;
|
||||
using Greenshot.Addons.Interfaces.Plugin;
|
||||
using Greenshot.Core.Enums;
|
||||
using Microsoft.Office.Interop.OneNote;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeExport
|
||||
{
|
||||
public static class OneNoteExporter
|
||||
{
|
||||
private const string XmlImageContent =
|
||||
"<one:Image format=\"png\"><one:Size width=\"{1}.0\" height=\"{2}.0\" isSetByUser=\"true\" /><one:Data>{0}</one:Data></one:Image>";
|
||||
/// <summary>
|
||||
/// OneNote exporter
|
||||
/// More details about OneNote: http://msdn.microsoft.com/en-us/magazine/ff796230.aspx
|
||||
/// </summary>
|
||||
public static class OneNoteExporter
|
||||
{
|
||||
private const string XmlImageContent = "<one:Image format=\"png\"><one:Size width=\"{1}.0\" height=\"{2}.0\" isSetByUser=\"true\" /><one:Data>{0}</one:Data></one:Image>";
|
||||
private const string XmlOutline = "<?xml version=\"1.0\"?><one:Page xmlns:one=\"{2}\" ID=\"{1}\"><one:Title><one:OE><one:T><![CDATA[{3}]]></one:T></one:OE></one:Title>{0}</one:Page>";
|
||||
private const string OnenoteNamespace2010 = "http://schemas.microsoft.com/office/onenote/2010/onenote";
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
|
||||
private const string XmlOutline =
|
||||
"<?xml version=\"1.0\"?><one:Page xmlns:one=\"{2}\" ID=\"{1}\"><one:Title><one:OE><one:T><![CDATA[{3}]]></one:T></one:OE></one:Title>{0}</one:Page>";
|
||||
/// <summary>
|
||||
/// Create a new page in the "unfiled notes section", with the title of the capture, and export the capture there.
|
||||
/// </summary>
|
||||
/// <param name="surfaceToUpload">ISurface</param>
|
||||
/// <returns>bool true if export worked</returns>
|
||||
public static bool ExportToNewPage(ISurface surfaceToUpload)
|
||||
{
|
||||
using (var oneNoteApplication = GetOrCreateOneNoteApplication())
|
||||
{
|
||||
var newPage = new OneNotePage();
|
||||
string unfiledNotesSectionId = GetSectionId(oneNoteApplication, SpecialLocation.slUnfiledNotesSection);
|
||||
if (unfiledNotesSectionId == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private const string OnenoteNamespace2010 = "http://schemas.microsoft.com/office/onenote/2010/onenote";
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
string pageId;
|
||||
oneNoteApplication.ComObject.CreateNewPage(unfiledNotesSectionId, out pageId, NewPageStyle.npsDefault);
|
||||
newPage.Id = pageId;
|
||||
// Set the new name, this is automatically done in the export to page
|
||||
newPage.Name = surfaceToUpload.CaptureDetails.Title;
|
||||
return ExportToPage(oneNoteApplication, surfaceToUpload, newPage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new page in the "unfiled notes section", with the title of the capture, and export the capture there.
|
||||
/// </summary>
|
||||
/// <param name="surfaceToUpload">ISurface</param>
|
||||
/// <returns>bool true if export worked</returns>
|
||||
public static bool ExportToNewPage(ISurface surfaceToUpload)
|
||||
{
|
||||
using (var oneNoteApplication = ComWrapper.GetOrCreateInstance<IOneNoteApplication>())
|
||||
{
|
||||
var newPage = new OneNotePage();
|
||||
var unfiledNotesSectionId = GetSectionId(oneNoteApplication, SpecialLocation.slUnfiledNotesSection);
|
||||
if (unfiledNotesSectionId == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Export the capture to the specified page
|
||||
/// </summary>
|
||||
/// <param name="surfaceToUpload">ISurface</param>
|
||||
/// <param name="page">OneNotePage</param>
|
||||
/// <returns>bool true if everything worked</returns>
|
||||
public static bool ExportToPage(ISurface surfaceToUpload, OneNotePage page)
|
||||
{
|
||||
using (var oneNoteApplication = GetOrCreateOneNoteApplication())
|
||||
{
|
||||
return ExportToPage(oneNoteApplication, surfaceToUpload, page);
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper disable once RedundantAssignment
|
||||
oneNoteApplication.CreateNewPage(unfiledNotesSectionId, out var pageId, NewPageStyle.npsDefault);
|
||||
newPage.ID = pageId;
|
||||
// Set the new name, this is automatically done in the export to page
|
||||
newPage.Name = surfaceToUpload.CaptureDetails.Title;
|
||||
return ExportToPage(oneNoteApplication, surfaceToUpload, newPage);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Export the capture to the specified page
|
||||
/// </summary>
|
||||
/// <param name="oneNoteApplication">IOneNoteApplication</param>
|
||||
/// <param name="surfaceToUpload">ISurface</param>
|
||||
/// <param name="page">OneNotePage</param>
|
||||
/// <returns>bool true if everything worked</returns>
|
||||
private static bool ExportToPage(IDisposableCom<Application> oneNoteApplication, ISurface surfaceToUpload, OneNotePage page)
|
||||
{
|
||||
if (oneNoteApplication == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Export the capture to the specified page
|
||||
/// </summary>
|
||||
/// <param name="surfaceToUpload">ISurface</param>
|
||||
/// <param name="page">OneNotePage</param>
|
||||
/// <returns>bool true if everything worked</returns>
|
||||
public static bool ExportToPage(ISurface surfaceToUpload, OneNotePage page)
|
||||
{
|
||||
using (var oneNoteApplication = ComWrapper.GetOrCreateInstance<IOneNoteApplication>())
|
||||
{
|
||||
return ExportToPage(oneNoteApplication, surfaceToUpload, page);
|
||||
}
|
||||
}
|
||||
using (var pngStream = new MemoryStream())
|
||||
{
|
||||
var pngOutputSettings = new SurfaceOutputSettings(OutputFormats.png, 100, false);
|
||||
ImageOutput.SaveToStream(surfaceToUpload, pngStream, pngOutputSettings);
|
||||
var base64String = Convert.ToBase64String(pngStream.GetBuffer());
|
||||
var imageXmlStr = string.Format(XmlImageContent, base64String, surfaceToUpload.Screenshot.Width, surfaceToUpload.Screenshot.Height);
|
||||
var pageChangesXml = string.Format(XmlOutline, imageXmlStr, page.Id, OnenoteNamespace2010, page.Name);
|
||||
Log.Info().WriteLine("Sending XML: {0}", pageChangesXml);
|
||||
oneNoteApplication.ComObject.UpdatePageContent(pageChangesXml, DateTime.MinValue, XMLSchema.xs2010, false);
|
||||
try
|
||||
{
|
||||
oneNoteApplication.ComObject.NavigateTo(page.Id, null, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex, "Unable to navigate to the target page");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Export the capture to the specified page
|
||||
/// </summary>
|
||||
/// <param name="oneNoteApplication">IOneNoteApplication</param>
|
||||
/// <param name="surfaceToUpload">ISurface</param>
|
||||
/// <param name="page">OneNotePage</param>
|
||||
/// <returns>bool true if everything worked</returns>
|
||||
private static bool ExportToPage(IOneNoteApplication oneNoteApplication, ISurface surfaceToUpload, OneNotePage page)
|
||||
{
|
||||
if (oneNoteApplication == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
using (var pngStream = new MemoryStream())
|
||||
{
|
||||
var pngOutputSettings = new SurfaceOutputSettings(OutputFormats.png, 100, false);
|
||||
ImageOutput.SaveToStream(surfaceToUpload, pngStream, pngOutputSettings);
|
||||
var base64String = Convert.ToBase64String(pngStream.GetBuffer());
|
||||
var imageXmlStr = string.Format(XmlImageContent, base64String, surfaceToUpload.Screenshot.Width, surfaceToUpload.Screenshot.Height);
|
||||
var pageChangesXml = string.Format(XmlOutline, imageXmlStr, page.ID, OnenoteNamespace2010, page.Name);
|
||||
Log.Info().WriteLine("Sending XML: {0}", pageChangesXml);
|
||||
oneNoteApplication.UpdatePageContent(pageChangesXml, DateTime.MinValue, XMLSchema.xs2010, false);
|
||||
try
|
||||
{
|
||||
oneNoteApplication.NavigateTo(page.ID, null, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex, "Unable to navigate to the target page");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Call this to get the running Excel application, returns null if there isn't any.
|
||||
/// </summary>
|
||||
/// <returns>ComDisposable for Excel.Application or null</returns>
|
||||
private static IDisposableCom<Application> GetOneNoteApplication()
|
||||
{
|
||||
IDisposableCom<Application> oneNoteApplication;
|
||||
try
|
||||
{
|
||||
oneNoteApplication = DisposableCom.Create((Application)Marshal.GetActiveObject("OneNote.Application"));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore, probably no OneNote running
|
||||
return null;
|
||||
}
|
||||
return oneNoteApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the Section ID for the specified special location
|
||||
/// </summary>
|
||||
/// <param name="oneNoteApplication"></param>
|
||||
/// <param name="specialLocation">SpecialLocation</param>
|
||||
/// <returns>string with section ID</returns>
|
||||
private static string GetSectionId(IOneNoteApplication oneNoteApplication, SpecialLocation specialLocation)
|
||||
{
|
||||
if (oneNoteApplication == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// ReSharper disable once RedundantAssignment
|
||||
var unfiledNotesPath = "";
|
||||
oneNoteApplication.GetSpecialLocation(specialLocation, out unfiledNotesPath);
|
||||
/// <summary>
|
||||
/// Call this to get the running OneNote application, or create a new instance
|
||||
/// </summary>
|
||||
/// <returns>ComDisposable for OneNote.Application</returns>
|
||||
private static IDisposableCom<Application> GetOrCreateOneNoteApplication()
|
||||
{
|
||||
var oneNoteApplication = GetOneNoteApplication();
|
||||
if (oneNoteApplication == null)
|
||||
{
|
||||
oneNoteApplication = DisposableCom.Create(new Application());
|
||||
}
|
||||
return oneNoteApplication;
|
||||
}
|
||||
|
||||
// ReSharper disable once RedundantAssignment
|
||||
var notebookXml = "";
|
||||
oneNoteApplication.GetHierarchy("", HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010);
|
||||
if (string.IsNullOrEmpty(notebookXml))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// Get the captions of all the open word documents
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IList<OneNotePage> GetPages()
|
||||
{
|
||||
var pages = new List<OneNotePage>();
|
||||
try
|
||||
{
|
||||
using (var oneNoteApplication = GetOrCreateOneNoteApplication())
|
||||
{
|
||||
if (oneNoteApplication != null)
|
||||
{
|
||||
// ReSharper disable once RedundantAssignment
|
||||
string notebookXml = "";
|
||||
oneNoteApplication.ComObject.GetHierarchy("", HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010);
|
||||
if (!string.IsNullOrEmpty(notebookXml))
|
||||
{
|
||||
Log.Debug().WriteLine(notebookXml);
|
||||
StringReader reader = null;
|
||||
try
|
||||
{
|
||||
reader = new StringReader(notebookXml);
|
||||
using (var xmlReader = new XmlTextReader(reader))
|
||||
{
|
||||
reader = null;
|
||||
OneNoteSection currentSection = null;
|
||||
OneNoteNotebook currentNotebook = null;
|
||||
while (xmlReader.Read())
|
||||
{
|
||||
if ("one:Notebook".Equals(xmlReader.Name))
|
||||
{
|
||||
string id = xmlReader.GetAttribute("ID");
|
||||
if ((id != null) && ((currentNotebook == null) || !id.Equals(currentNotebook.Id)))
|
||||
{
|
||||
currentNotebook = new OneNoteNotebook();
|
||||
currentNotebook.Id = xmlReader.GetAttribute("ID");
|
||||
currentNotebook.Name = xmlReader.GetAttribute("name");
|
||||
}
|
||||
}
|
||||
if ("one:Section".Equals(xmlReader.Name))
|
||||
{
|
||||
string id = xmlReader.GetAttribute("ID");
|
||||
if ((id != null) && ((currentSection == null) || !id.Equals(currentSection.Id)))
|
||||
{
|
||||
currentSection = new OneNoteSection
|
||||
{
|
||||
Id = xmlReader.GetAttribute("ID"),
|
||||
Name = xmlReader.GetAttribute("name"),
|
||||
Parent = currentNotebook
|
||||
};
|
||||
}
|
||||
}
|
||||
if ("one:Page".Equals(xmlReader.Name))
|
||||
{
|
||||
// Skip deleted items
|
||||
if ("true".Equals(xmlReader.GetAttribute("isInRecycleBin")))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Log.Debug().WriteLine(notebookXml);
|
||||
StringReader reader = null;
|
||||
try
|
||||
{
|
||||
reader = new StringReader(notebookXml);
|
||||
using (var xmlReader = new XmlTextReader(reader))
|
||||
{
|
||||
while (xmlReader.Read())
|
||||
{
|
||||
if (!"one:Section".Equals(xmlReader.Name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var page = new OneNotePage
|
||||
{
|
||||
Parent = currentSection,
|
||||
Name = xmlReader.GetAttribute("name"),
|
||||
Id = xmlReader.GetAttribute("ID")
|
||||
};
|
||||
if ((page.Id == null) || (page.Name == null))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
page.IsCurrentlyViewed = "true".Equals(xmlReader.GetAttribute("isCurrentlyViewed"));
|
||||
pages.Add(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (reader != null)
|
||||
{
|
||||
reader.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (COMException cEx)
|
||||
{
|
||||
if (cEx.ErrorCode == unchecked((int)0x8002801D))
|
||||
{
|
||||
Log.Warn().WriteLine("Wrong registry keys, to solve this remove the OneNote key as described here: http://microsoftmercenary.com/wp/outlook-excel-interop-calls-breaking-solved/");
|
||||
}
|
||||
Log.Warn().WriteLine(cEx, "Problem retrieving onenote destinations, ignoring: ");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex, "Problem retrieving onenote destinations, ignoring: ");
|
||||
}
|
||||
pages.Sort((page1, page2) =>
|
||||
{
|
||||
if (page1.IsCurrentlyViewed || page2.IsCurrentlyViewed)
|
||||
{
|
||||
return page2.IsCurrentlyViewed.CompareTo(page1.IsCurrentlyViewed);
|
||||
}
|
||||
return string.Compare(page1.DisplayName, page2.DisplayName, StringComparison.Ordinal);
|
||||
});
|
||||
return pages;
|
||||
}
|
||||
|
||||
var id = xmlReader.GetAttribute("ID");
|
||||
var path = xmlReader.GetAttribute("path");
|
||||
if (unfiledNotesPath.Equals(path))
|
||||
{
|
||||
return id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
reader?.Dispose();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// Retrieve the Section ID for the specified special location
|
||||
/// </summary>
|
||||
/// <param name="oneNoteApplication"></param>
|
||||
/// <param name="specialLocation">SpecialLocation</param>
|
||||
/// <returns>string with section ID</returns>
|
||||
private static string GetSectionId(IDisposableCom<Application> oneNoteApplication, SpecialLocation specialLocation)
|
||||
{
|
||||
if (oneNoteApplication == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// ReSharper disable once RedundantAssignment
|
||||
string unfiledNotesPath = "";
|
||||
oneNoteApplication.ComObject.GetSpecialLocation(specialLocation, out unfiledNotesPath);
|
||||
|
||||
/// <summary>
|
||||
/// Get the captions of all the open word documents
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<OneNotePage> GetPages()
|
||||
{
|
||||
using (var oneNoteApplication = ComWrapper.GetOrCreateInstance<IOneNoteApplication>())
|
||||
{
|
||||
if (oneNoteApplication == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
// ReSharper disable once RedundantAssignment
|
||||
string notebookXml = "";
|
||||
oneNoteApplication.ComObject.GetHierarchy("", HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010);
|
||||
if (!string.IsNullOrEmpty(notebookXml))
|
||||
{
|
||||
Log.Debug().WriteLine(notebookXml);
|
||||
StringReader reader = null;
|
||||
try
|
||||
{
|
||||
reader = new StringReader(notebookXml);
|
||||
using (var xmlReader = new XmlTextReader(reader))
|
||||
{
|
||||
while (xmlReader.Read())
|
||||
{
|
||||
if (!"one:Section".Equals(xmlReader.Name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string id = xmlReader.GetAttribute("ID");
|
||||
string path = xmlReader.GetAttribute("path");
|
||||
if (unfiledNotesPath.Equals(path))
|
||||
{
|
||||
return id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (reader != null)
|
||||
{
|
||||
reader.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper disable once RedundantAssignment
|
||||
var notebookXml = "";
|
||||
oneNoteApplication.GetHierarchy("", HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010);
|
||||
if (string.IsNullOrEmpty(notebookXml))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
/// <summary>
|
||||
/// Container for transporting Page information
|
||||
/// </summary>
|
||||
public class OneNotePage
|
||||
{
|
||||
public string DisplayName
|
||||
{
|
||||
get
|
||||
{
|
||||
OneNoteNotebook notebook = Parent.Parent;
|
||||
if (string.IsNullOrEmpty(notebook.Name))
|
||||
{
|
||||
return string.Format("{0} / {1}", Parent.Name, Name);
|
||||
}
|
||||
return string.Format("{0} / {1} / {2}", Parent.Parent.Name, Parent.Name, Name);
|
||||
}
|
||||
}
|
||||
|
||||
using (var reader = new StringReader(notebookXml))
|
||||
using (var xmlReader = new XmlTextReader(reader))
|
||||
{
|
||||
OneNoteSection currentSection = null;
|
||||
OneNoteNotebook currentNotebook = null;
|
||||
while (xmlReader.Read())
|
||||
{
|
||||
switch (xmlReader.Name)
|
||||
{
|
||||
case "one:Notebook":
|
||||
{
|
||||
var id = xmlReader.GetAttribute("ID");
|
||||
if (id != null && (currentNotebook == null || !id.Equals(currentNotebook.ID)))
|
||||
{
|
||||
currentNotebook = new OneNoteNotebook
|
||||
{
|
||||
ID = xmlReader.GetAttribute("ID"),
|
||||
Name = xmlReader.GetAttribute("name")
|
||||
};
|
||||
}
|
||||
public string Id { get; set; }
|
||||
|
||||
break;
|
||||
}
|
||||
case "one:Section":
|
||||
{
|
||||
var id = xmlReader.GetAttribute("ID");
|
||||
if (id != null && (currentSection == null || !id.Equals(currentSection.ID)))
|
||||
{
|
||||
currentSection = new OneNoteSection
|
||||
{
|
||||
ID = xmlReader.GetAttribute("ID"),
|
||||
Name = xmlReader.GetAttribute("name"),
|
||||
Parent = currentNotebook
|
||||
};
|
||||
}
|
||||
public bool IsCurrentlyViewed { get; set; }
|
||||
|
||||
break;
|
||||
}
|
||||
case "one:Page":
|
||||
// Skip deleted items
|
||||
if ("true".Equals(xmlReader.GetAttribute("isInRecycleBin")))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var page = new OneNotePage
|
||||
{
|
||||
Parent = currentSection,
|
||||
Name = xmlReader.GetAttribute("name"),
|
||||
ID = xmlReader.GetAttribute("ID")
|
||||
};
|
||||
if (page.ID == null || page.Name == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
page.IsCurrentlyViewed = "true".Equals(xmlReader.GetAttribute("isCurrentlyViewed"));
|
||||
yield return page;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Name { get; set; }
|
||||
|
||||
public OneNoteSection Parent { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Container for transporting section information
|
||||
/// </summary>
|
||||
public class OneNoteSection
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public OneNoteNotebook Parent { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Container for transporting notebook information
|
||||
/// </summary>
|
||||
public class OneNoteNotebook
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -26,295 +26,356 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dapplo.Ini;
|
||||
using Dapplo.Log;
|
||||
using Dapplo.Windows.Com;
|
||||
using Greenshot.Addon.Office.OfficeInterop;
|
||||
using Microsoft.Office.Core;
|
||||
using Microsoft.Office.Interop.PowerPoint;
|
||||
using Shape = Microsoft.Office.Interop.PowerPoint.Shape;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeExport
|
||||
{
|
||||
public static class PowerpointExporter
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static Version _powerpointVersion;
|
||||
private static readonly IOfficeConfiguration officeConfiguration = IniConfig.Current.Get<IOfficeConfiguration>();
|
||||
public static class PowerpointExporter
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static readonly IOfficeConfiguration OfficeConfig = IniConfig.Current.Get<IOfficeConfiguration>();
|
||||
private static Version _powerpointVersion;
|
||||
|
||||
private static bool IsAfter2003()
|
||||
{
|
||||
return _powerpointVersion.Major > (int) OfficeVersions.Office2003;
|
||||
}
|
||||
/// <summary>
|
||||
/// Internal method to add a picture to a presentation
|
||||
/// </summary>
|
||||
/// <param name="presentation"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
/// <param name="title"></param>
|
||||
private static void AddPictureToPresentation(IDisposableCom<Presentation> presentation, string tmpFile, Size imageSize, string title)
|
||||
{
|
||||
if (presentation != null)
|
||||
{
|
||||
//ISlide slide = presentation.Slides.AddSlide( presentation.Slides.Count + 1, PPSlideLayout.ppLayoutPictureWithCaption);
|
||||
IDisposableCom<Slide> slide = null;
|
||||
try
|
||||
{
|
||||
float left, top;
|
||||
using (var pageSetup = DisposableCom.Create(presentation.ComObject.PageSetup))
|
||||
{
|
||||
left = pageSetup.ComObject.SlideWidth / 2 - imageSize.Width / 2f;
|
||||
top = pageSetup.ComObject.SlideHeight / 2 - imageSize.Height / 2f;
|
||||
}
|
||||
float width = imageSize.Width;
|
||||
float height = imageSize.Height;
|
||||
IDisposableCom<Shape> shapeForCaption = null;
|
||||
bool hasScaledWidth = false;
|
||||
bool hasScaledHeight = false;
|
||||
try
|
||||
{
|
||||
using (var slides = DisposableCom.Create(presentation.ComObject.Slides))
|
||||
{
|
||||
slide = DisposableCom.Create(slides.ComObject.Add(slides.ComObject.Count + 1, OfficeConfig.PowerpointSlideLayout));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the captions of all the open powerpoint presentations
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetPowerpointPresentations()
|
||||
{
|
||||
var foundPresentations = new List<string>();
|
||||
try
|
||||
{
|
||||
using (var powerpointApplication = GetPowerpointApplication())
|
||||
{
|
||||
if (powerpointApplication == null)
|
||||
{
|
||||
return foundPresentations;
|
||||
}
|
||||
using (var shapes = DisposableCom.Create(slide.ComObject.Shapes))
|
||||
{
|
||||
using (var shapeForLocation = DisposableCom.Create(shapes.ComObject[2]))
|
||||
{
|
||||
// Shapes[2] is the image shape on this layout.
|
||||
shapeForCaption = DisposableCom.Create(shapes.ComObject[1]);
|
||||
if (width > shapeForLocation.ComObject.Width)
|
||||
{
|
||||
width = shapeForLocation.ComObject.Width;
|
||||
left = shapeForLocation.ComObject.Left;
|
||||
hasScaledWidth = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
shapeForLocation.ComObject.Left = left;
|
||||
}
|
||||
shapeForLocation.ComObject.Width = imageSize.Width;
|
||||
|
||||
using (var presentations = powerpointApplication.Presentations)
|
||||
{
|
||||
Log.Debug().WriteLine("Open Presentations: {0}", presentations.Count);
|
||||
for (var i = 1; i <= presentations.Count; i++)
|
||||
{
|
||||
using (var presentation = presentations.item(i))
|
||||
{
|
||||
if (presentation == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (presentation.ReadOnly == MsoTriState.msoTrue)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (height > shapeForLocation.ComObject.Height)
|
||||
{
|
||||
height = shapeForLocation.ComObject.Height;
|
||||
top = shapeForLocation.ComObject.Top;
|
||||
hasScaledHeight = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
top = shapeForLocation.ComObject.Top + shapeForLocation.ComObject.Height / 2 - imageSize.Height / 2f;
|
||||
}
|
||||
shapeForLocation.ComObject.Height = imageSize.Height;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error().WriteLine(e, "Powerpoint shape creating failed");
|
||||
using (var slides = DisposableCom.Create(presentation.ComObject.Slides))
|
||||
{
|
||||
slide = DisposableCom.Create(slides.ComObject.Add(slides.ComObject.Count + 1, PpSlideLayout.ppLayoutBlank));
|
||||
}
|
||||
}
|
||||
using (var shapes = DisposableCom.Create(slide.ComObject.Shapes))
|
||||
{
|
||||
using (var shape = DisposableCom.Create(shapes.ComObject.AddPicture(tmpFile, MsoTriState.msoFalse, MsoTriState.msoTrue, 0, 0, width, height)))
|
||||
{
|
||||
if (OfficeConfig.PowerpointLockAspectRatio)
|
||||
{
|
||||
shape.ComObject.LockAspectRatio = MsoTriState.msoTrue;
|
||||
}
|
||||
else
|
||||
{
|
||||
shape.ComObject.LockAspectRatio = MsoTriState.msoFalse;
|
||||
}
|
||||
shape.ComObject.ScaleHeight(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromMiddle);
|
||||
shape.ComObject.ScaleWidth(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromMiddle);
|
||||
if (hasScaledWidth)
|
||||
{
|
||||
shape.ComObject.Width = width;
|
||||
}
|
||||
if (hasScaledHeight)
|
||||
{
|
||||
shape.ComObject.Height = height;
|
||||
}
|
||||
shape.ComObject.Left = left;
|
||||
shape.ComObject.Top = top;
|
||||
shape.ComObject.AlternativeText = title;
|
||||
}
|
||||
}
|
||||
if (shapeForCaption != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (shapeForCaption)
|
||||
{
|
||||
// Using try/catch to make sure problems with the text range don't give an exception.
|
||||
using (var textFrame = DisposableCom.Create(shapeForCaption.ComObject.TextFrame))
|
||||
{
|
||||
using (var textRange = DisposableCom.Create(textFrame.ComObject.TextRange))
|
||||
{
|
||||
textRange.ComObject.Text = title;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex, "Problem setting the title to a text-range");
|
||||
}
|
||||
}
|
||||
// Activate/Goto the slide
|
||||
try
|
||||
{
|
||||
using (var application = DisposableCom.Create(presentation.ComObject.Application))
|
||||
{
|
||||
using (var activeWindow = DisposableCom.Create(application.ComObject.ActiveWindow))
|
||||
{
|
||||
using (var view = DisposableCom.Create(activeWindow.ComObject.View))
|
||||
{
|
||||
view.ComObject.GotoSlide(slide.ComObject.SlideNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex, "Problem going to the slide");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
slide?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IsAfter2003() && presentation.Final)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
/// <summary>
|
||||
/// Export the image from the tmpfile to the presentation with the supplied name
|
||||
/// </summary>
|
||||
/// <param name="presentationName">Name of the presentation to insert to</param>
|
||||
/// <param name="tmpFile">Filename of the image file to insert</param>
|
||||
/// <param name="imageSize">Size of the image</param>
|
||||
/// <param name="title">A string with the image title</param>
|
||||
/// <returns></returns>
|
||||
public static bool ExportToPresentation(string presentationName, string tmpFile, Size imageSize, string title)
|
||||
{
|
||||
using (var powerpointApplication = GetPowerPointApplication())
|
||||
{
|
||||
if (powerpointApplication == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
using (var presentations = DisposableCom.Create(powerpointApplication.ComObject.Presentations))
|
||||
{
|
||||
Log.Debug().WriteLine("Open Presentations: {0}", presentations.ComObject.Count);
|
||||
for (int i = 1; i <= presentations.ComObject.Count; i++)
|
||||
{
|
||||
using (var presentation = DisposableCom.Create(presentations.ComObject[i]))
|
||||
{
|
||||
if (presentation == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!presentation.ComObject.Name.StartsWith(presentationName))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
AddPictureToPresentation(presentation, tmpFile, imageSize, title);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error().WriteLine(e, "Adding picture to powerpoint failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
foundPresentations.Add(presentation.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex, "Problem retrieving word destinations, ignoring: ");
|
||||
}
|
||||
foundPresentations.Sort();
|
||||
return foundPresentations;
|
||||
}
|
||||
/// <summary>
|
||||
/// Call this to get the running PowerPoint application, or create a new instance
|
||||
/// </summary>
|
||||
/// <returns>ComDisposable for PowerPoint.Application</returns>
|
||||
private static IDisposableCom<Application> GetOrCreatePowerPointApplication()
|
||||
{
|
||||
IDisposableCom<Application> powerPointApplication = GetPowerPointApplication();
|
||||
if (powerPointApplication == null)
|
||||
{
|
||||
powerPointApplication = DisposableCom.Create(new Application());
|
||||
}
|
||||
InitializeVariables(powerPointApplication);
|
||||
return powerPointApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Export the image from the tmpfile to the presentation with the supplied name
|
||||
/// </summary>
|
||||
/// <param name="presentationName">Name of the presentation to insert to</param>
|
||||
/// <param name="tmpFile">Filename of the image file to insert</param>
|
||||
/// <param name="imageSize">Size of the image</param>
|
||||
/// <param name="title">A string with the image title</param>
|
||||
/// <returns></returns>
|
||||
public static bool ExportToPresentation(string presentationName, string tmpFile, Size imageSize, string title)
|
||||
{
|
||||
using (var powerpointApplication = GetPowerpointApplication())
|
||||
{
|
||||
if (powerpointApplication == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
using (var presentations = powerpointApplication.Presentations)
|
||||
{
|
||||
Log.Debug().WriteLine("Open Presentations: {0}", presentations.Count);
|
||||
for (var i = 1; i <= presentations.Count; i++)
|
||||
{
|
||||
using (var presentation = presentations.item(i))
|
||||
{
|
||||
if (presentation == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!presentation.Name.StartsWith(presentationName))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
AddPictureToPresentation(presentation, tmpFile, imageSize, title);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error().WriteLine(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Call this to get the running PowerPoint application, returns null if there isn't any.
|
||||
/// </summary>
|
||||
/// <returns>ComDisposable for PowerPoint.Application or null</returns>
|
||||
private static IDisposableCom<Application> GetPowerPointApplication()
|
||||
{
|
||||
IDisposableCom<Application> powerPointApplication;
|
||||
try
|
||||
{
|
||||
powerPointApplication = DisposableCom.Create((Application)Marshal.GetActiveObject("PowerPoint.Application"));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore, probably no PowerPoint running
|
||||
return null;
|
||||
}
|
||||
if (powerPointApplication.ComObject != null)
|
||||
{
|
||||
InitializeVariables(powerPointApplication);
|
||||
}
|
||||
return powerPointApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal method to add a picture to a presentation
|
||||
/// </summary>
|
||||
/// <param name="presentation"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
/// <param name="title"></param>
|
||||
private static void AddPictureToPresentation(IPresentation presentation, string tmpFile, Size imageSize, string title)
|
||||
{
|
||||
if (presentation == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
/// Get the captions of all the open powerpoint presentations
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> GetPowerpointPresentations()
|
||||
{
|
||||
using (var powerpointApplication = GetPowerPointApplication())
|
||||
{
|
||||
if (powerpointApplication == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
//ISlide slide = presentation.Slides.AddSlide( presentation.Slides.Count + 1, PPSlideLayout.ppLayoutPictureWithCaption);
|
||||
ISlide slide;
|
||||
var left = presentation.PageSetup.SlideWidth / 2 - imageSize.Width / 2f;
|
||||
var top = presentation.PageSetup.SlideHeight / 2 - imageSize.Height / 2f;
|
||||
float width = imageSize.Width;
|
||||
float height = imageSize.Height;
|
||||
IShape shapeForCaption = null;
|
||||
var hasScaledWidth = false;
|
||||
var hasScaledHeight = false;
|
||||
try
|
||||
{
|
||||
slide = presentation.Slides.Add(presentation.Slides.Count + 1, (int) officeConfiguration.PowerpointSlideLayout);
|
||||
// Shapes[2] is the image shape on this layout.
|
||||
shapeForCaption = slide.Shapes.item(1);
|
||||
var shapeForLocation = slide.Shapes.item(2);
|
||||
using (var presentations = DisposableCom.Create(powerpointApplication.ComObject.Presentations))
|
||||
{
|
||||
Log.Debug().WriteLine("Open Presentations: {0}", presentations.ComObject.Count);
|
||||
for (int i = 1; i <= presentations.ComObject.Count; i++)
|
||||
{
|
||||
using (var presentation = DisposableCom.Create(presentations.ComObject[i]))
|
||||
{
|
||||
if (presentation == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (presentation.ComObject.ReadOnly == MsoTriState.msoTrue)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (IsAfter2003())
|
||||
{
|
||||
if (presentation.ComObject.Final)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
yield return presentation.ComObject.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (width > shapeForLocation.Width)
|
||||
{
|
||||
width = shapeForLocation.Width;
|
||||
left = shapeForLocation.Left;
|
||||
hasScaledWidth = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
shapeForLocation.Left = left;
|
||||
}
|
||||
shapeForLocation.Width = imageSize.Width;
|
||||
/// <summary>
|
||||
/// Initialize static powerpoint variables like version
|
||||
/// </summary>
|
||||
/// <param name="powerpointApplication">IPowerpointApplication</param>
|
||||
private static void InitializeVariables(IDisposableCom<Application> powerpointApplication)
|
||||
{
|
||||
if ((powerpointApplication == null) || (powerpointApplication.ComObject == null) || (_powerpointVersion != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!Version.TryParse(powerpointApplication.ComObject.Version, out _powerpointVersion))
|
||||
{
|
||||
Log.Warn().WriteLine("Assuming Powerpoint version 1997.");
|
||||
_powerpointVersion = new Version((int)OfficeVersions.Office97, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (height > shapeForLocation.Height)
|
||||
{
|
||||
height = shapeForLocation.Height;
|
||||
top = shapeForLocation.Top;
|
||||
hasScaledHeight = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
top = shapeForLocation.Top + shapeForLocation.Height / 2 - imageSize.Height / 2f;
|
||||
}
|
||||
shapeForLocation.Height = imageSize.Height;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error().WriteLine(e);
|
||||
slide = presentation.Slides.Add(presentation.Slides.Count + 1, (int) PPSlideLayout.ppLayoutBlank);
|
||||
}
|
||||
var shape = slide.Shapes.AddPicture(tmpFile, MsoTriState.msoFalse, MsoTriState.msoTrue, 0, 0, width, height);
|
||||
shape.LockAspectRatio = officeConfiguration.PowerpointLockAspectRatio ? MsoTriState.msoTrue : MsoTriState.msoFalse;
|
||||
shape.ScaleHeight(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromMiddle);
|
||||
shape.ScaleWidth(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromMiddle);
|
||||
if (hasScaledWidth)
|
||||
{
|
||||
shape.Width = width;
|
||||
}
|
||||
if (hasScaledHeight)
|
||||
{
|
||||
shape.Height = height;
|
||||
}
|
||||
shape.Left = left;
|
||||
shape.Top = top;
|
||||
shape.AlternativeText = title;
|
||||
if (shapeForCaption != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Using try/catch to make sure problems with the text range don't give an exception.
|
||||
var textFrame = shapeForCaption.TextFrame;
|
||||
textFrame.TextRange.Text = title;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex, "Problem setting the title to a text-range");
|
||||
}
|
||||
}
|
||||
presentation.Application.ActiveWindow.View.GotoSlide(slide.SlideNumber);
|
||||
presentation.Application.Activate();
|
||||
}
|
||||
/// <summary>
|
||||
/// Insert a capture into a new presentation
|
||||
/// </summary>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <returns></returns>
|
||||
public static bool InsertIntoNewPresentation(string tmpFile, Size imageSize, string title)
|
||||
{
|
||||
bool isPictureAdded = false;
|
||||
using (var powerpointApplication = GetOrCreatePowerPointApplication())
|
||||
{
|
||||
if (powerpointApplication != null)
|
||||
{
|
||||
powerpointApplication.ComObject.Activate();
|
||||
powerpointApplication.ComObject.Visible = MsoTriState.msoTrue;
|
||||
using (var presentations = DisposableCom.Create(powerpointApplication.ComObject.Presentations))
|
||||
{
|
||||
using (var presentation = DisposableCom.Create(presentations.ComObject.Add()))
|
||||
{
|
||||
try
|
||||
{
|
||||
AddPictureToPresentation(presentation, tmpFile, imageSize, title);
|
||||
isPictureAdded = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error().WriteLine(e, "Powerpoint add picture to presentation failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return isPictureAdded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Insert a capture into a new presentation
|
||||
/// </summary>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="imageSize"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <returns></returns>
|
||||
public static bool InsertIntoNewPresentation(string tmpFile, Size imageSize, string title)
|
||||
{
|
||||
var isPictureAdded = false;
|
||||
using (var powerpointApplication = GetOrCreatePowerpointApplication())
|
||||
{
|
||||
if (powerpointApplication == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
private static bool IsAfter2003()
|
||||
{
|
||||
return _powerpointVersion.Major > (int)OfficeVersions.Office2003;
|
||||
}
|
||||
}
|
||||
|
||||
powerpointApplication.Visible = true;
|
||||
using (var presentations = powerpointApplication.Presentations)
|
||||
{
|
||||
using (var presentation = presentations.Add(MsoTriState.msoTrue))
|
||||
{
|
||||
try
|
||||
{
|
||||
AddPictureToPresentation(presentation, tmpFile, imageSize, title);
|
||||
isPictureAdded = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error().WriteLine(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return isPictureAdded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this to get the running powerpoint application, returns null if there isn't any.
|
||||
/// </summary>
|
||||
/// <returns>IPowerpointApplication or null</returns>
|
||||
private static IPowerpointApplication GetPowerpointApplication()
|
||||
{
|
||||
var powerpointApplication = ComWrapper.GetInstance<IPowerpointApplication>();
|
||||
InitializeVariables(powerpointApplication);
|
||||
return powerpointApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this to get the running powerpoint application, or create a new instance
|
||||
/// </summary>
|
||||
/// <returns>IPowerpointApplication</returns>
|
||||
private static IPowerpointApplication GetOrCreatePowerpointApplication()
|
||||
{
|
||||
var powerpointApplication = ComWrapper.GetOrCreateInstance<IPowerpointApplication>();
|
||||
InitializeVariables(powerpointApplication);
|
||||
return powerpointApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize static outlook variables like version and currentuser
|
||||
/// </summary>
|
||||
/// <param name="powerpointApplication">IPowerpointApplication</param>
|
||||
private static void InitializeVariables(IPowerpointApplication powerpointApplication)
|
||||
{
|
||||
if (powerpointApplication == null || _powerpointVersion != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_powerpointVersion = new Version(powerpointApplication.Version);
|
||||
Log.Info().WriteLine("Using Powerpoint {0}", _powerpointVersion);
|
||||
}
|
||||
catch (Exception exVersion)
|
||||
{
|
||||
Log.Error().WriteLine(exVersion);
|
||||
Log.Warn().WriteLine("Assuming Powerpoint version 1997.");
|
||||
_powerpointVersion = new Version((int) OfficeVersions.Office97, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,378 +1,375 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2017 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub: https://github.com/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#region Usings
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dapplo.Ini;
|
||||
using Dapplo.Log;
|
||||
using Dapplo.Windows.Com;
|
||||
using Dapplo.Windows.Desktop;
|
||||
using Greenshot.Addon.Office.OfficeInterop;
|
||||
using Microsoft.Office.Core;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
using Version = System.Version;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeExport
|
||||
{
|
||||
/// <summary>
|
||||
/// This is responsible for exporting to word
|
||||
/// </summary>
|
||||
public static class WordExporter
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static Version _wordVersion;
|
||||
private static readonly IOfficeConfiguration OfficeConfig = IniConfig.Current.Get<IOfficeConfiguration>();
|
||||
public static class WordExporter
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static Version _wordVersion;
|
||||
private static readonly IOfficeConfiguration Config = IniConfig.Current.Get<IOfficeConfiguration>();
|
||||
|
||||
/// <summary>
|
||||
/// Check if the used version is higher than Office 2003
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static bool IsAfter2003()
|
||||
{
|
||||
return _wordVersion.Major > (int) OfficeVersions.Office2003;
|
||||
}
|
||||
/// <summary>
|
||||
/// Helper method to add the file as image to the selection
|
||||
/// </summary>
|
||||
/// <param name="selection"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <returns></returns>
|
||||
private static IDisposableCom<InlineShape> AddPictureToSelection(IDisposableCom<Selection> selection, string tmpFile)
|
||||
{
|
||||
using (var shapes = DisposableCom.Create(selection.ComObject.InlineShapes))
|
||||
{
|
||||
var shape = DisposableCom.Create(shapes.ComObject.AddPicture(tmpFile, false, true, Type.Missing));
|
||||
// Lock aspect ratio
|
||||
if (Config.WordLockAspectRatio)
|
||||
{
|
||||
shape.ComObject.LockAspectRatio = MsoTriState.msoTrue;
|
||||
}
|
||||
selection.ComObject.InsertAfter("\r\n");
|
||||
selection.ComObject.MoveDown(WdUnits.wdLine, 1, Type.Missing);
|
||||
return shape;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Insert the bitmap stored under the tempfile path into the word document with the supplied caption
|
||||
/// </summary>
|
||||
/// <param name="wordCaption">string</param>
|
||||
/// <param name="tmpFile">string</param>
|
||||
/// <returns>true if it worked</returns>
|
||||
public static bool InsertIntoExistingDocument(string wordCaption, string tmpFile)
|
||||
{
|
||||
using (var wordApplication = GetWordApplication())
|
||||
{
|
||||
if (wordApplication == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
using (var documents = wordApplication.Documents)
|
||||
{
|
||||
for (var i = 1; i <= documents.Count; i++)
|
||||
{
|
||||
using (var wordDocument = documents.item(i))
|
||||
{
|
||||
using (var activeWindow = wordDocument.ActiveWindow)
|
||||
{
|
||||
if (activeWindow.Caption.StartsWith(wordCaption))
|
||||
{
|
||||
return InsertIntoExistingDocument(wordApplication, wordDocument, tmpFile, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Call this to get the running Word application, or create a new instance
|
||||
/// </summary>
|
||||
/// <returns>ComDisposable for Word.Application</returns>
|
||||
private static IDisposableCom<Application> GetOrCreateWordApplication()
|
||||
{
|
||||
IDisposableCom<Application> wordApplication = GetWordApplication();
|
||||
if (wordApplication == null)
|
||||
{
|
||||
wordApplication = DisposableCom.Create(new Application());
|
||||
}
|
||||
InitializeVariables(wordApplication);
|
||||
return wordApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal method for the insert
|
||||
/// </summary>
|
||||
/// <param name="wordApplication"></param>
|
||||
/// <param name="wordDocument"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="address">link for the image</param>
|
||||
/// <param name="tooltip">tooltip of the image</param>
|
||||
/// <returns></returns>
|
||||
internal static bool InsertIntoExistingDocument(IWordApplication wordApplication, IWordDocument wordDocument, string tmpFile, string address, string tooltip)
|
||||
{
|
||||
// Bug #1517: image will be inserted into that document, where the focus was last. It will not inserted into the chosen one.
|
||||
// Solution: Make sure the selected document is active, otherwise the insert will be made in a different document!
|
||||
try
|
||||
{
|
||||
wordDocument.Activate();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
using (var selection = wordApplication.Selection)
|
||||
{
|
||||
if (selection == null)
|
||||
{
|
||||
Log.Info().WriteLine("No selection to insert {0} into found.", tmpFile);
|
||||
return false;
|
||||
}
|
||||
// Add Picture
|
||||
using (var shape = AddPictureToSelection(selection, tmpFile))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
{
|
||||
var screentip = Type.Missing;
|
||||
if (!string.IsNullOrEmpty(tooltip))
|
||||
{
|
||||
screentip = tooltip;
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var hyperlinks = wordDocument.Hyperlinks)
|
||||
{
|
||||
hyperlinks.Add(shape, screentip, Type.Missing, screentip, Type.Missing, Type.Missing);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Warn().WriteLine("Couldn't add hyperlink for image: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var activeWindow = wordDocument.ActiveWindow)
|
||||
{
|
||||
activeWindow.Activate();
|
||||
using (var activePane = activeWindow.ActivePane)
|
||||
{
|
||||
using (var view = activePane.View)
|
||||
{
|
||||
view.Zoom.Percentage = 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Warn().WriteLine("Couldn't set zoom to 100, error: {0}", e.InnerException?.Message ?? e.Message);
|
||||
}
|
||||
try
|
||||
{
|
||||
wordApplication.Activate();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var activeWindow = wordDocument.ActiveWindow)
|
||||
{
|
||||
activeWindow.Activate();
|
||||
var hWnd = activeWindow.Hwnd;
|
||||
if (hWnd > 0)
|
||||
{
|
||||
// TODO: Await?
|
||||
InteropWindowFactory.CreateFor(new IntPtr(hWnd)).ToForegroundAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Call this to get the running Word application, returns null if there isn't any.
|
||||
/// </summary>
|
||||
/// <returns>ComDisposable for Word.Application or null</returns>
|
||||
private static IDisposableCom<Application> GetWordApplication()
|
||||
{
|
||||
IDisposableCom<Application> wordApplication;
|
||||
try
|
||||
{
|
||||
wordApplication = DisposableCom.Create((Application)Marshal.GetActiveObject("Word.Application"));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore, probably no word running
|
||||
return null;
|
||||
}
|
||||
if ((wordApplication != null) && (wordApplication.ComObject != null))
|
||||
{
|
||||
InitializeVariables(wordApplication);
|
||||
}
|
||||
return wordApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to add the file as image to the selection
|
||||
/// </summary>
|
||||
/// <param name="selection"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <returns></returns>
|
||||
private static IInlineShape AddPictureToSelection(ISelection selection, string tmpFile)
|
||||
{
|
||||
using (var shapes = selection.InlineShapes)
|
||||
{
|
||||
var shape = shapes.AddPicture(tmpFile, false, true, Type.Missing);
|
||||
// Lock aspect ratio
|
||||
if (OfficeConfig.WordLockAspectRatio)
|
||||
{
|
||||
shape.LockAspectRatio = MsoTriState.msoTrue;
|
||||
}
|
||||
selection.InsertAfter("\r\n");
|
||||
selection.MoveDown(WdUnits.wdLine, 1, Type.Missing);
|
||||
return shape;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Get the captions of all the open word documents
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> GetWordDocuments()
|
||||
{
|
||||
using (var wordApplication = GetWordApplication())
|
||||
{
|
||||
if (wordApplication == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
using (var documents = DisposableCom.Create(wordApplication.ComObject.Documents))
|
||||
{
|
||||
for (int i = 1; i <= documents.ComObject.Count; i++)
|
||||
{
|
||||
using (var document = DisposableCom.Create(documents.ComObject[i]))
|
||||
{
|
||||
if (document.ComObject.ReadOnly)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (IsAfter2003())
|
||||
{
|
||||
if (document.ComObject.Final)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
using (var activeWindow = DisposableCom.Create(document.ComObject.ActiveWindow))
|
||||
{
|
||||
yield return activeWindow.ComObject.Caption;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void InsertIntoNewDocument(string tmpFile, string address, string tooltip)
|
||||
{
|
||||
using (var wordApplication = GetOrCreateWordApplication())
|
||||
{
|
||||
if (wordApplication == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
wordApplication.Visible = true;
|
||||
wordApplication.Activate();
|
||||
// Create new Document
|
||||
object template = string.Empty;
|
||||
object newTemplate = false;
|
||||
object documentType = 0;
|
||||
object documentVisible = true;
|
||||
using (var documents = wordApplication.Documents)
|
||||
{
|
||||
using (var wordDocument = documents.Add(ref template, ref newTemplate, ref documentType, ref documentVisible))
|
||||
{
|
||||
using (var selection = wordApplication.Selection)
|
||||
{
|
||||
// Add Picture
|
||||
using (var shape = AddPictureToSelection(selection, tmpFile))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
{
|
||||
var screentip = Type.Missing;
|
||||
if (!string.IsNullOrEmpty(tooltip))
|
||||
{
|
||||
screentip = tooltip;
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var hyperlinks = wordDocument.Hyperlinks)
|
||||
{
|
||||
hyperlinks.Add(shape, screentip, Type.Missing, screentip, Type.Missing, Type.Missing);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Warn().WriteLine("Couldn't add hyperlink for image: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
wordDocument.Activate();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var activeWindow = wordDocument.ActiveWindow)
|
||||
{
|
||||
activeWindow.Activate();
|
||||
var hWnd = activeWindow.Hwnd;
|
||||
if (hWnd > 0)
|
||||
{
|
||||
// TODO: Await?
|
||||
InteropWindowFactory.CreateFor(new IntPtr(hWnd)).ToForegroundAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Initialize static word variables like version
|
||||
/// </summary>
|
||||
/// <param name="wordApplication"></param>
|
||||
private static void InitializeVariables(IDisposableCom<Application> wordApplication)
|
||||
{
|
||||
if ((wordApplication == null) || (wordApplication.ComObject == null) || (_wordVersion != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!Version.TryParse(wordApplication.ComObject.Version, out _wordVersion))
|
||||
{
|
||||
Log.Warn().WriteLine("Assuming Word version 1997.");
|
||||
_wordVersion = new Version((int)OfficeVersions.Office97, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the captions of all the open word documents
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetWordDocuments()
|
||||
{
|
||||
var openDocuments = new List<string>();
|
||||
try
|
||||
{
|
||||
using (var wordApplication = GetWordApplication())
|
||||
{
|
||||
if (wordApplication == null)
|
||||
{
|
||||
return openDocuments;
|
||||
}
|
||||
using (var documents = wordApplication.Documents)
|
||||
{
|
||||
for (var i = 1; i <= documents.Count; i++)
|
||||
{
|
||||
using (var document = documents.item(i))
|
||||
{
|
||||
if (document.ReadOnly)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
/// <summary>
|
||||
/// Insert the bitmap stored under the tempfile path into the word document with the supplied caption
|
||||
/// </summary>
|
||||
/// <param name="wordCaption"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <returns></returns>
|
||||
public static bool InsertIntoExistingDocument(string wordCaption, string tmpFile)
|
||||
{
|
||||
using (var wordApplication = GetWordApplication())
|
||||
{
|
||||
if (wordApplication == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
using (var documents = DisposableCom.Create(wordApplication.ComObject.Documents))
|
||||
{
|
||||
for (int i = 1; i <= documents.ComObject.Count; i++)
|
||||
{
|
||||
using (var wordDocument = DisposableCom.Create((_Document)documents.ComObject[i]))
|
||||
{
|
||||
using (var activeWindow = DisposableCom.Create(wordDocument.ComObject.ActiveWindow))
|
||||
{
|
||||
if (activeWindow.ComObject.Caption.StartsWith(wordCaption))
|
||||
{
|
||||
return InsertIntoExistingDocument(wordApplication, wordDocument, tmpFile, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsAfter2003() && document.Final)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
/// <summary>
|
||||
/// Internal method for the insert
|
||||
/// </summary>
|
||||
/// <param name="wordApplication"></param>
|
||||
/// <param name="wordDocument"></param>
|
||||
/// <param name="tmpFile"></param>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="tooltip">tooltip of the image</param>
|
||||
/// <returns></returns>
|
||||
internal static bool InsertIntoExistingDocument(IDisposableCom<Application> wordApplication, IDisposableCom<_Document> wordDocument, string tmpFile, string address, string tooltip)
|
||||
{
|
||||
// Bug #1517: image will be inserted into that document, where the focus was last. It will not inserted into the chosen one.
|
||||
// Solution: Make sure the selected document is active, otherwise the insert will be made in a different document!
|
||||
try
|
||||
{
|
||||
wordDocument.ComObject.Activate();
|
||||
// ReSharper disable once EmptyGeneralCatchClause
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex);
|
||||
}
|
||||
using (var selection = DisposableCom.Create(wordApplication.ComObject.Selection))
|
||||
{
|
||||
if (selection == null)
|
||||
{
|
||||
Log.Info().WriteLine("No selection to insert {0} into found.", tmpFile);
|
||||
return false;
|
||||
}
|
||||
// Add Picture
|
||||
using (var shape = AddPictureToSelection(selection, tmpFile))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
{
|
||||
object screentip = Type.Missing;
|
||||
if (!string.IsNullOrEmpty(tooltip))
|
||||
{
|
||||
screentip = tooltip;
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var hyperlinks = DisposableCom.Create(wordDocument.ComObject.Hyperlinks))
|
||||
{
|
||||
hyperlinks.ComObject.Add(shape, screentip, Type.Missing, screentip, Type.Missing, Type.Missing);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Warn().WriteLine("Couldn't add hyperlink for image: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var activeWindow = DisposableCom.Create(wordDocument.ComObject.ActiveWindow))
|
||||
{
|
||||
activeWindow.ComObject.Activate();
|
||||
using (var activePane = DisposableCom.Create(activeWindow.ComObject.ActivePane))
|
||||
{
|
||||
using (var view = DisposableCom.Create(activePane.ComObject.View))
|
||||
{
|
||||
view.ComObject.Zoom.Percentage = 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
Log.Warn().WriteLine("Couldn't set zoom to 100, error: {0}", e.InnerException.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warn().WriteLine("Couldn't set zoom to 100, error: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
wordApplication.ComObject.Activate();
|
||||
// ReSharper disable once EmptyGeneralCatchClause
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex);
|
||||
}
|
||||
try
|
||||
{
|
||||
wordDocument.ComObject.Activate();
|
||||
// ReSharper disable once EmptyGeneralCatchClause
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
using (var activeWindow = document.ActiveWindow)
|
||||
{
|
||||
openDocuments.Add(activeWindow.Caption);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex, "Problem retrieving word destinations, ignoring: ");
|
||||
}
|
||||
openDocuments.Sort();
|
||||
return openDocuments;
|
||||
}
|
||||
public static void InsertIntoNewDocument(string tmpFile, string address, string tooltip)
|
||||
{
|
||||
using (var wordApplication = GetOrCreateWordApplication())
|
||||
{
|
||||
if (wordApplication == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
wordApplication.ComObject.Visible = true;
|
||||
wordApplication.ComObject.Activate();
|
||||
// Create new Document
|
||||
object template = string.Empty;
|
||||
object newTemplate = false;
|
||||
object documentType = 0;
|
||||
object documentVisible = true;
|
||||
using (var documents = DisposableCom.Create(wordApplication.ComObject.Documents))
|
||||
{
|
||||
using (var wordDocument = DisposableCom.Create(documents.ComObject.Add(template, newTemplate, documentType, documentVisible)))
|
||||
{
|
||||
using (var selection = DisposableCom.Create(wordApplication.ComObject.Selection))
|
||||
{
|
||||
// Add Picture
|
||||
using (var shape = AddPictureToSelection(selection, tmpFile))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
{
|
||||
object screentip = Type.Missing;
|
||||
if (!string.IsNullOrEmpty(tooltip))
|
||||
{
|
||||
screentip = tooltip;
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var hyperlinks = DisposableCom.Create(wordDocument.ComObject.Hyperlinks))
|
||||
{
|
||||
using (DisposableCom.Create(hyperlinks.ComObject.Add(shape, screentip, Type.Missing, screentip, Type.Missing, Type.Missing)))
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Warn().WriteLine("Couldn't add hyperlink for image: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
wordDocument.ComObject.Activate();
|
||||
// ReSharper disable once EmptyGeneralCatchClause
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex);
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var activeWindow = DisposableCom.Create(wordDocument.ComObject.ActiveWindow))
|
||||
{
|
||||
activeWindow.ComObject.Activate();
|
||||
}
|
||||
// ReSharper disable once EmptyGeneralCatchClause
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn().WriteLine(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this to get the running outlook application, returns null if there isn't any.
|
||||
/// </summary>
|
||||
/// <returns>IWordApplication or null</returns>
|
||||
private static IWordApplication GetWordApplication()
|
||||
{
|
||||
var wordApplication = ComWrapper.GetInstance<IWordApplication>();
|
||||
InitializeVariables(wordApplication);
|
||||
return wordApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this to get the running word application, or create a new instance
|
||||
/// </summary>
|
||||
/// <returns>IWordApplication</returns>
|
||||
private static IWordApplication GetOrCreateWordApplication()
|
||||
{
|
||||
var wordApplication = ComWrapper.GetOrCreateInstance<IWordApplication>();
|
||||
InitializeVariables(wordApplication);
|
||||
return wordApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize static outlook variables like version and currentuser
|
||||
/// </summary>
|
||||
/// <param name="wordApplication"></param>
|
||||
private static void InitializeVariables(IWordApplication wordApplication)
|
||||
{
|
||||
if (wordApplication == null || _wordVersion != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_wordVersion = new Version(wordApplication.Version);
|
||||
Log.Info().WriteLine("Using Word {0}", _wordVersion);
|
||||
}
|
||||
catch (Exception exVersion)
|
||||
{
|
||||
Log.Error().WriteLine(exVersion);
|
||||
Log.Warn().WriteLine("Assuming Word version 1997.");
|
||||
_wordVersion = new Version((int) OfficeVersions.Office97, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Check if the used version is higher than Office 2003
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static bool IsAfter2003()
|
||||
{
|
||||
return _wordVersion.Major > (int)OfficeVersions.Office2003;
|
||||
}
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@ namespace Greenshot.Addon.Office.OfficeInterop
|
||||
/// <summary>
|
||||
/// Specifies which EmailFormat the email needs to use
|
||||
/// </summary>
|
||||
public enum EmailFormats
|
||||
public enum EmailFormat
|
||||
{
|
||||
Text,
|
||||
Html
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum HierarchyScope
|
||||
{
|
||||
hsSelf = 0, // Gets just the start node specified and no descendants.
|
||||
hsChildren = 1, //Gets the immediate child nodes of the start node, and no descendants in higher or lower subsection groups.
|
||||
hsNotebooks = 2, // Gets all notebooks below the start node, or root.
|
||||
hsSections = 3, //Gets all sections below the start node, including sections in section groups and subsection groups.
|
||||
hsPages = 4 //Gets all pages below the start node, including all pages in section groups and subsection groups.
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.appointmentitem.aspx
|
||||
/// and: https://msdn.microsoft.com/en-us/library/ff869026.aspx
|
||||
/// </summary>
|
||||
public interface IAppointmentItem : IItem, IComCommon
|
||||
{
|
||||
string Organizer { get; set; }
|
||||
|
||||
string SendUsingAccount { get; }
|
||||
|
||||
string Categories { get; }
|
||||
|
||||
DateTime Start { get; }
|
||||
|
||||
DateTime End { get; }
|
||||
|
||||
OlReoccurenceState RecurrenceState { get; }
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.attachment_members.aspx
|
||||
/// </summary>
|
||||
public interface IAttachment : IComCommon
|
||||
{
|
||||
string DisplayName { get; set; }
|
||||
|
||||
string FileName { get; }
|
||||
|
||||
OlAttachmentType Type { get; }
|
||||
|
||||
IPropertyAccessor PropertyAccessor { get; }
|
||||
|
||||
object MAPIOBJECT { get; }
|
||||
|
||||
void SaveAsFile(string path);
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public interface IAttachments : IComCollection
|
||||
{
|
||||
// Use index+1!!!!
|
||||
IAttachment this[object index] { get; }
|
||||
|
||||
IAttachment Add(object source, object type, object position, object displayName);
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System.Collections;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// If the "type" this[object index] { get; } is implemented, use index + 1!!! (starts at 1)
|
||||
/// </summary>
|
||||
public interface IComCollection : IComCommon, IEnumerable
|
||||
{
|
||||
int Count { get; }
|
||||
|
||||
void Remove(int index);
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// Common properties that has appreared in almost all objects
|
||||
/// </summary>
|
||||
public interface IComCommon : IDisposable
|
||||
{
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// Is a joined interface of the Explorer an Inspector
|
||||
/// </summary>
|
||||
public interface ICommonExplorer : IComCommon
|
||||
{
|
||||
string Caption { get; }
|
||||
|
||||
int Height { get; set; }
|
||||
|
||||
int Left { get; set; }
|
||||
|
||||
int Top { get; set; }
|
||||
|
||||
int Width { get; set; }
|
||||
|
||||
OlWindowState WindowState { get; set; }
|
||||
|
||||
void Activate();
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.contactitem.aspx
|
||||
/// </summary>
|
||||
public interface IContactItem : IItem, IComCommon
|
||||
{
|
||||
bool HasPicture { get; }
|
||||
|
||||
string FirstName { get; set; }
|
||||
|
||||
string LastName { get; set; }
|
||||
|
||||
void SaveBusinessCardImage(string path);
|
||||
void AddPicture(string path);
|
||||
void RemovePicture();
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public interface IDocuments : IComCommon, IComCollection
|
||||
{
|
||||
IWordDocument Add(ref object Template, ref object NewTemplate, ref object DocumentType, ref object Visible);
|
||||
IWordDocument item(int index);
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using Dapplo.Windows.Com;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.application.aspx
|
||||
/// </summary>
|
||||
[ComProgId("Excel.Application")]
|
||||
public interface IExcelApplication : IComCommon
|
||||
{
|
||||
IWorkbook ActiveWorkbook { get; }
|
||||
|
||||
//ISelection Selection {get;}
|
||||
IWorkbooks Workbooks { get; }
|
||||
|
||||
bool Visible { get; set; }
|
||||
|
||||
string Version { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns an Integer indicating the top-level window handle of the Microsoft Excel window.
|
||||
/// </summary>
|
||||
int Hwnd { get; }
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// Since Outlook 2010, but since 2013 one can edit inside an explorer
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.explorer_members(v=office.15).aspx
|
||||
/// </summary>
|
||||
public interface IExplorer : ICommonExplorer
|
||||
{
|
||||
IItem ActiveInlineResponse { get; }
|
||||
|
||||
IWordDocument ActiveInlineResponseWordEditor { get; }
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System.Collections;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// Since Outlook 2010, but since 2013 one can edit inside an explorer
|
||||
/// See: http://msdn.microsoft.com/en-us/library/office/ff867227(v=office.15).aspx
|
||||
/// </summary>
|
||||
public interface IExplorers : IComCommon, IComCollection, IEnumerable
|
||||
{
|
||||
// Use index + 1!!
|
||||
IExplorer this[object Index] { get; }
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/bb176362%28v=office.12%29.aspx
|
||||
/// </summary>
|
||||
public interface IFolder : IComCommon
|
||||
{
|
||||
IItems Items { get; }
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.hyperlink_members%28v=office.14%29.aspx
|
||||
/// </summary>
|
||||
public interface IHyperlink : IComCommon
|
||||
{
|
||||
string Address { get; set; }
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.hyperlinks%28v=office.14%29.aspx
|
||||
/// </summary>
|
||||
public interface IHyperlinks : IComCommon, IComCollection
|
||||
{
|
||||
IHyperlink Add(object Anchor, object Address, object SubAddress, object ScreenTip, object TextToDisplay, object Target);
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See:
|
||||
/// http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.inlineshape_members%28v=office.14%29.aspx
|
||||
/// </summary>
|
||||
public interface IInlineShape : IComCommon
|
||||
{
|
||||
IHyperlink Hyperlink { get; }
|
||||
|
||||
MsoTriState LockAspectRatio { get; set; }
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/ms263866%28v=office.14%29.aspx
|
||||
/// </summary>
|
||||
public interface IInlineShapes : IComCommon
|
||||
{
|
||||
IInlineShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Range);
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.inspector_members.aspx
|
||||
/// </summary>
|
||||
public interface IInspector : ICommonExplorer
|
||||
{
|
||||
IItem CurrentItem { get; }
|
||||
|
||||
OlEditorType EditorType { get; }
|
||||
|
||||
object ModifiedFormPages { get; }
|
||||
|
||||
object HTMLEditor { get; }
|
||||
|
||||
IWordDocument WordEditor { get; }
|
||||
|
||||
void Close(OlInspectorClose SaveMode);
|
||||
void Display(object Modal);
|
||||
void HideFormPage(string PageName);
|
||||
bool IsWordMail();
|
||||
void SetCurrentFormPage(string PageName);
|
||||
void ShowFormPage(string PageName);
|
||||
void SetControlItemProperty(object Control, string PropertyName);
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._application.inspectors.aspx
|
||||
/// </summary>
|
||||
public interface IInspectors : IComCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// Use index + 1!!
|
||||
/// </summary>
|
||||
/// <param name="index">index to the inspectors,using a +1 offset!</param>
|
||||
/// <returns>IInspector</returns>
|
||||
IInspector this[object index] { get; }
|
||||
}
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// Common attributes of all the Items (MailItem, AppointmentItem)
|
||||
/// See: http://msdn.microsoft.com/en-us/library/ff861252.aspx
|
||||
/// </summary>
|
||||
public interface IItem : IComCommon
|
||||
{
|
||||
IAttachments Attachments { get; }
|
||||
|
||||
string Body { get; set; }
|
||||
|
||||
OlObjectClass Class { get; }
|
||||
|
||||
DateTime CreationTime { get; }
|
||||
|
||||
string EntryID { get; }
|
||||
|
||||
DateTime LastModificationTime { get; }
|
||||
|
||||
string MessageClass { get; set; }
|
||||
|
||||
bool NoAging { get; set; }
|
||||
|
||||
int OutlookInternalVersion { get; }
|
||||
|
||||
string OutlookVersion { get; }
|
||||
|
||||
bool Saved { get; }
|
||||
|
||||
OlSensitivity Sensitivity { get; set; }
|
||||
|
||||
int Size { get; }
|
||||
|
||||
string Subject { get; set; }
|
||||
|
||||
bool UnRead { get; set; }
|
||||
|
||||
IPropertyAccessor PropertyAccessor { get; }
|
||||
|
||||
object Copy();
|
||||
void Display(bool Modal);
|
||||
void Save();
|
||||
IInspector GetInspector();
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System.Collections;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/bb208387%28v=office.12%29.aspx
|
||||
/// </summary>
|
||||
public interface IItems : IComCollection, IEnumerable
|
||||
{
|
||||
IItem this[object index] { get; }
|
||||
|
||||
bool IncludeRecurrences { get; set; }
|
||||
|
||||
IItem GetFirst();
|
||||
IItem GetNext();
|
||||
IItem GetLast();
|
||||
IItem GetPrevious();
|
||||
|
||||
IItems Restrict(string filter);
|
||||
void Sort(string property, object descending);
|
||||
|
||||
// Actual definition is "object Add( object )", just making it convenient
|
||||
object Add(OlItemType type);
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.mailitem.aspx
|
||||
/// and : http://msdn.microsoft.com/en-us/library/ff861252.aspx
|
||||
/// </summary>
|
||||
public interface IMailItem : IItem, IComCommon
|
||||
{
|
||||
bool Sent { get; }
|
||||
|
||||
object MAPIOBJECT { get; }
|
||||
|
||||
string HTMLBody { get; set; }
|
||||
|
||||
DateTime ExpiryTime { get; set; }
|
||||
|
||||
DateTime ReceivedTime { get; }
|
||||
|
||||
string SenderName { get; }
|
||||
|
||||
DateTime SentOn { get; }
|
||||
|
||||
OlBodyFormat BodyFormat { get; set; }
|
||||
|
||||
string To { get; set; }
|
||||
|
||||
string CC { get; set; }
|
||||
|
||||
string BCC { get; set; }
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/bb176693%28v=office.12%29.aspx
|
||||
/// </summary>
|
||||
public interface INameSpace : IComCommon
|
||||
{
|
||||
IRecipient CurrentUser { get; }
|
||||
|
||||
IFolder GetDefaultFolder(OlDefaultFolders defaultFolder);
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System;
|
||||
using Dapplo.Windows.Com;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// More details about OneNote: http://msdn.microsoft.com/en-us/magazine/ff796230.aspx
|
||||
/// See
|
||||
/// http://msdn.microsoft.com/en-US/library/microsoft.office.interop.word.applicationclass_members%28v=Office.11%29.aspx
|
||||
/// </summary>
|
||||
[ComProgId("OneNote.Application")]
|
||||
public interface IOneNoteApplication : IComCommon
|
||||
{
|
||||
/// <summary>
|
||||
/// Make sure that the out variables are filled with a string, e.g. "", otherwise a type error occurs.
|
||||
/// For more info on the methods: http://msdn.microsoft.com/en-us/library/gg649853.aspx
|
||||
/// </summary>
|
||||
void GetHierarchy(string startNode, HierarchyScope scope, out string notebookXml, XMLSchema schema);
|
||||
|
||||
void GetSpecialLocation(SpecialLocation specialLocation, out string specialLocationPath);
|
||||
void UpdatePageContent(string pageChangesXml, DateTime dateExpectedLastModified, XMLSchema schema, bool force);
|
||||
void GetPageContent(string pageId, out string pageXml, PageInfo pageInfoToExport, XMLSchema schema);
|
||||
void NavigateTo(string hierarchyObjectID, string objectId, bool newWindow);
|
||||
void CreateNewPage(string sectionID, out string pageID, NewPageStyle newPageStyle);
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using Dapplo.Windows.Com;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper for Outlook.Application, see: http://msdn.microsoft.com/en-us/library/aa210897%28v=office.11%29.aspx
|
||||
/// This is the initial COM-Object which is created/retrieved
|
||||
/// </summary>
|
||||
[ComProgId("Outlook.Application")]
|
||||
public interface IOutlookApplication : IComCommon
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
string Version { get; }
|
||||
|
||||
IInspectors Inspectors { get; }
|
||||
|
||||
IExplorers Explorers { get; }
|
||||
|
||||
IItem CreateItem(OlItemType itemType);
|
||||
object CreateItemFromTemplate(string templatePath, object inFolder);
|
||||
object CreateObject(string objectName);
|
||||
IInspector ActiveInspector();
|
||||
INameSpace GetNameSpace(string type);
|
||||
IExplorer ActiveExplorer();
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pane_members.aspx
|
||||
/// </summary>
|
||||
public interface IPane : IComCommon
|
||||
{
|
||||
IWordView View { get; }
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// The collection of pictures
|
||||
/// </summary>
|
||||
public interface IPictures : IComCollection
|
||||
{
|
||||
// Use index + 1!!
|
||||
//IPicture this[object Index] { get; }
|
||||
void Insert(string file);
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.propertyaccessor_members.aspx
|
||||
/// </summary>
|
||||
public interface IPropertyAccessor : IComCommon
|
||||
{
|
||||
void SetProperty(string SchemaName, object Value);
|
||||
object GetProperty(string SchemaName);
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public interface IRecipient : IComCommon
|
||||
{
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.selection_members(v=office.11).aspx
|
||||
/// </summary>
|
||||
public interface ISelection : IComCommon
|
||||
{
|
||||
IInlineShapes InlineShapes { get; }
|
||||
void InsertAfter(string text);
|
||||
int MoveDown(object Unit, object Count, object Extend);
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using Dapplo.Windows.Com;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
// See http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.applicationclass_members%28v=Office.11%29.aspx
|
||||
[ComProgId("Word.Application")]
|
||||
public interface IWordApplication : IComCommon
|
||||
{
|
||||
IWordDocument ActiveDocument { get; }
|
||||
ISelection Selection { get; }
|
||||
IDocuments Documents { get; }
|
||||
bool Visible { get; set; }
|
||||
string Version { get; }
|
||||
void Activate();
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.documents_members(v=office.11).aspx
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.document%28v=office.14%29.aspx
|
||||
/// </summary>
|
||||
public interface IWordDocument : IComCommon
|
||||
{
|
||||
IWordApplication Application { get; }
|
||||
IWordWindow ActiveWindow { get; }
|
||||
bool ReadOnly { get; }
|
||||
IHyperlinks Hyperlinks { get; }
|
||||
|
||||
// Only 2007 and later!
|
||||
bool Final { get; set; }
|
||||
void Activate();
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.view_members.aspx
|
||||
/// </summary>
|
||||
public interface IWordView : IComCommon
|
||||
{
|
||||
IZoom Zoom { get; }
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.window_members.aspx
|
||||
/// </summary>
|
||||
public interface IWordWindow : IComCommon
|
||||
{
|
||||
IPane ActivePane { get; }
|
||||
|
||||
string Caption { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns an Integer (int in C#) that indicates the window handle of the specified window
|
||||
/// </summary>
|
||||
int Hwnd { get; }
|
||||
|
||||
void Activate();
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbook.aspx
|
||||
/// </summary>
|
||||
public interface IWorkbook : IComCommon
|
||||
{
|
||||
IWorksheet ActiveSheet { get; }
|
||||
|
||||
string Name { get; }
|
||||
|
||||
IWorksheets Worksheets { get; }
|
||||
|
||||
void Activate();
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbooks.aspx
|
||||
/// </summary>
|
||||
public interface IWorkbooks : IComCommon, IComCollection
|
||||
{
|
||||
// Use index + 1!!
|
||||
IWorkbook this[object index] { get; }
|
||||
|
||||
IWorkbook Add(object template);
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._worksheet_members.aspx
|
||||
/// </summary>
|
||||
public interface IWorksheet : IComCommon
|
||||
{
|
||||
IPictures Pictures { get; }
|
||||
|
||||
IShapes Shapes { get; }
|
||||
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.iworksheets_members.aspx
|
||||
/// </summary>
|
||||
public interface IWorksheets : IComCollection
|
||||
{
|
||||
// Use index + 1!!
|
||||
IWorksheet this[object index] { get; }
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See
|
||||
/// <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.zoom_members.aspx">Zoom members</a>
|
||||
/// </summary>
|
||||
public interface IZoom : IComCommon
|
||||
{
|
||||
int Percentage { get; set; }
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum MsoTriState
|
||||
{
|
||||
msoTrue = -1,
|
||||
msoFalse = 0,
|
||||
msoCTrue = 1,
|
||||
msoTriStateToggle = -3,
|
||||
msoTriStateMixed = -2
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum NewPageStyle
|
||||
{
|
||||
npsDefault = 0,
|
||||
npsBlankPageWithTitle = 1,
|
||||
npsBlankPageNoTitle = 2
|
||||
}
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Greenshot.Interop;
|
||||
using Greenshot.Interop.Office;
|
||||
|
||||
namespace GreenshotInterop.OfficeInterop {
|
||||
// See: http://msdn.microsoft.com/en-us/library/bb758788%28v=office.12%29
|
||||
[ComProgId("Communicator.UIAutomation")]
|
||||
public interface IMessenger : Common {
|
||||
void AutoSignin();
|
||||
string MyServiceId {
|
||||
get;
|
||||
}
|
||||
IMessengerContact GetContact(string signinName, string serviceId);
|
||||
IMessengerWindow InstantMessage(string contact);
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/bb787250%28v=office.12%29
|
||||
public interface IMessengerContact : Common {
|
||||
string FriendlyName {
|
||||
get;
|
||||
}
|
||||
string ServiceName {
|
||||
get;
|
||||
}
|
||||
string ServiceId {
|
||||
get;
|
||||
}
|
||||
string SigninName {
|
||||
get;
|
||||
}
|
||||
MISTATUS Status {
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/bb787207%28v=office.12%29
|
||||
public enum MISTATUS {
|
||||
MISTATUS_UNKNOWN = 0x0000,
|
||||
MISTATUS_OFFLINE = 0x0001,
|
||||
MISTATUS_ONLINE = 0x0002,
|
||||
MISTATUS_INVISIBLE = 0x0006,
|
||||
MISTATUS_BUSY = 0x000A,
|
||||
MISTATUS_BE_RIGHT_BACK = 0x000E,
|
||||
MISTATUS_IDLE = 0x0012,
|
||||
MISTATUS_AWAY = 0x0022,
|
||||
MISTATUS_ON_THE_PHONE = 0x0032,
|
||||
MISTATUS_OUT_TO_LUNCH = 0x0042,
|
||||
MISTATUS_IN_A_MEETING = 0x0052,
|
||||
MISTATUS_OUT_OF_OFFICE = 0x0062,
|
||||
MISTATUS_DO_NOT_DISTURB = 0x0072,
|
||||
MISTATUS_IN_A_CONFERENCE = 0x0082,
|
||||
MISTATUS_ALLOW_URGENT_INTERRUPTIONS = 0x0092,
|
||||
MISTATUS_MAY_BE_AVAILABLE = 0x00A2,
|
||||
MISTATUS_CUSTOM = 0x00B2,
|
||||
MISTATUS_LOCAL_FINDING_SERVER = 0x0100,
|
||||
MISTATUS_LOCAL_CONNECTING_TO_SERVER = 0x0200,
|
||||
MISTATUS_LOCAL_SYNCHRONIZING_WITH_SERVER = 0x0300,
|
||||
MISTATUS_LOCAL_DISCONNECTING_FROM_SERVER = 0x0400
|
||||
} ;
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/bb758816%28v=office.12%29
|
||||
public interface IMessengerWindow : Common {
|
||||
bool IsClosed {
|
||||
get;
|
||||
}
|
||||
void Show();
|
||||
}
|
||||
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlAttachmentType
|
||||
{
|
||||
// Fields
|
||||
olByReference = 4,
|
||||
olByValue = 1,
|
||||
olEmbeddeditem = 5,
|
||||
olOLE = 6
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlBodyFormat
|
||||
{
|
||||
// Fields
|
||||
olFormatHTML = 2,
|
||||
olFormatPlain = 1,
|
||||
olFormatRichText = 3,
|
||||
olFormatUnspecified = 0
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlDefaultFolders
|
||||
{
|
||||
olFolderCalendar = 9, // The Calendar folder.
|
||||
olFolderConflicts = 19, // The Conflicts folder (subfolder of Sync Issues folder). Only available for an Exchange account.
|
||||
olFolderContacts = 10, // The Contacts folder.
|
||||
olFolderDeletedItems = 3, // The Deleted Items folder.
|
||||
olFolderDrafts = 16, // The Drafts folder.
|
||||
olFolderInbox = 6, // The Inbox folder.
|
||||
olFolderJournal = 11, // The Journal folder.
|
||||
olFolderJunk = 23, // The Junk E-Mail folder.
|
||||
olFolderLocalFailures = 21, // The Local Failures folder (subfolder of Sync Issues folder). Only available for an Exchange account.
|
||||
olFolderManagedEmail = 29,
|
||||
// The top-level folder in the Managed Folders group. For more information on Managed Folders, see Help in Microsoft Outlook. Only available for an Exchange account.
|
||||
olFolderNotes = 12, // The Notes folder.
|
||||
olFolderOutbox = 4, // The Outbox folder.
|
||||
olFolderSentMail = 5, // The Sent Mail folder.
|
||||
olFolderServerFailures = 22, // The Server Failures folder (subfolder of Sync Issues folder). Only available for an Exchange account.
|
||||
olFolderSyncIssues = 20, // The Sync Issues folder. Only available for an Exchange account.
|
||||
olFolderTasks = 13, // The Tasks folder.
|
||||
olFolderToDo = 28, // The To Do folder.
|
||||
olPublicFoldersAllPublicFolders = 18, // The All Public Folders folder in the Exchange Public Folders store. Only available for an Exchange account.
|
||||
olFolderRssFeeds = 25 // The RSS Feeds folder.
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlEditorType
|
||||
{
|
||||
// Fields
|
||||
olEditorHTML = 2,
|
||||
olEditorRTF = 3,
|
||||
olEditorText = 1,
|
||||
olEditorWord = 4
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlInspectorClose
|
||||
{
|
||||
// Fields
|
||||
olDiscard = 1,
|
||||
olPromptForSave = 2,
|
||||
olSave = 0
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlItemType
|
||||
{
|
||||
// Fields
|
||||
olAppointmentItem = 1,
|
||||
olContactItem = 2,
|
||||
olDistributionListItem = 7,
|
||||
olJournalItem = 4,
|
||||
olMailItem = 0,
|
||||
olNoteItem = 5,
|
||||
olPostItem = 6,
|
||||
olTaskItem = 3
|
||||
}
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// See: https://msdn.microsoft.com/en-us/library/ff863329.aspx
|
||||
/// </summary>
|
||||
public enum OlObjectClass
|
||||
{
|
||||
olAccount = 105, // Represents an Account object.
|
||||
olAccountRuleCondition = 135, // Represents an AccountRuleCondition object.
|
||||
olAccounts = 106, // Represents an Accounts object.
|
||||
olAction = 32, // Represents an Action object.
|
||||
olActions = 33, // Represents an Actions object.
|
||||
olAddressEntries = 21, // Represents an AddressEntries object.
|
||||
olAddressEntry = 8, // Represents an AddressEntry object.
|
||||
olAddressList = 7, // Represents an AddressList object.
|
||||
olAddressLists = 20, // Represents an AddressLists object.
|
||||
olAddressRuleCondition = 170, // Represents an AddressRuleCondition object.
|
||||
olApplication = 0, // Represents an Application object.
|
||||
olAppointment = 26, // Represents an AppointmentItem object.
|
||||
olAssignToCategoryRuleAction = 122, // Represents an AssignToCategoryRuleAction object.
|
||||
olAttachment = 5, // Represents an Attachment object.
|
||||
olAttachments = 18, // Represents an Attachments object.
|
||||
olAttachmentSelection = 169, // Represents an AttachmentSelection object.
|
||||
olAutoFormatRule = 147, // Represents an AutoFormatRule object.
|
||||
olAutoFormatRules = 148, // Represents an AutoFormatRules object.
|
||||
olCalendarModule = 159, // Represents a CalendarModule object.
|
||||
olCalendarSharing = 151, // Represents a CalendarSharing object.
|
||||
olCategories = 153, // Represents a Categories object.
|
||||
olCategory = 152, // Represents a Category object.
|
||||
olCategoryRuleCondition = 130, // Represents a CategoryRuleCondition object.
|
||||
olClassBusinessCardView = 168, // Represents a BusinessCardView object.
|
||||
olClassCalendarView = 139, // Represents a CalendarView object.
|
||||
olClassCardView = 138, // Represents a CardView object.
|
||||
olClassIconView = 137, // Represents a IconView object.
|
||||
olClassNavigationPane = 155, // Represents a NavigationPane object.
|
||||
olClassTableView = 136, // Represents a TableView object.
|
||||
olClassTimeLineView = 140, // Represents a TimelineView object.
|
||||
olClassTimeZone = 174, // Represents a TimeZone object.
|
||||
olClassTimeZones = 175, // Represents a TimeZones object.
|
||||
olColumn = 154, // Represents a Column object.
|
||||
olColumnFormat = 149, // Represents a ColumnFormat object.
|
||||
olColumns = 150, // Represents a Columns object.
|
||||
olConflict = 102, // Represents a Conflict object.
|
||||
olConflicts = 103, // Represents a Conflicts object.
|
||||
olContact = 40, // Represents a ContactItem object.
|
||||
olContactsModule = 160, // Represents a ContactsModule object.
|
||||
olDistributionList = 69, // Represents a ExchangeDistributionList object.
|
||||
olDocument = 41, // Represents a DocumentItem object.
|
||||
olException = 30, // Represents an Exception object.
|
||||
olExceptions = 29, // Represents an Exceptions object.
|
||||
olExchangeDistributionList = 111, // Represents an ExchangeDistributionList object.
|
||||
olExchangeUser = 110, // Represents an ExchangeUser object.
|
||||
olExplorer = 34, // Represents an Explorer object.
|
||||
olExplorers = 60, // Represents an Explorers object.
|
||||
olFolder = 2, // Represents a Folder object.
|
||||
olFolders = 15, // Represents a Folders object.
|
||||
olFolderUserProperties = 172, // Represents a UserDefinedProperties object.
|
||||
olFolderUserProperty = 171, // Represents a UserDefinedProperty object.
|
||||
olFormDescription = 37, // Represents a FormDescription object.
|
||||
olFormNameRuleCondition = 131, // Represents a FormNameRuleCondition object.
|
||||
olFormRegion = 129, // Represents a FormRegion object.
|
||||
olFromRssFeedRuleCondition = 173, // Represents a FromRssFeedRuleCondition object.
|
||||
olFromRuleCondition = 132, // Represents a ToOrFromRuleCondition object.
|
||||
olImportanceRuleCondition = 128, // Represents an ImportanceRuleCondition object.
|
||||
olInspector = 35, // Represents an Inspector object.
|
||||
olInspectors = 61, // Represents an Inspectors object.
|
||||
olItemProperties = 98, // Represents an ItemProperties object.
|
||||
olItemProperty = 99, // Represents an ItemProperty object.
|
||||
olItems = 16, // Represents an Items object.
|
||||
olJournal = 42, // Represents a JournalItem object.
|
||||
olJournalModule = 162, // Represents a JournalModule object.
|
||||
olLink = 75, // Represents a Link object.
|
||||
olLinks = 76, // Represents a Links object.
|
||||
olMail = 43, // Represents a MailItem object.
|
||||
olMailModule = 158, // Represents a MailModule object.
|
||||
olMarkAsTaskRuleAction = 124, // Represents a MarkAsTaskRuleAction object.
|
||||
olMeetingCancellation = 54, // Represents a MeetingItem object that is a meeting cancellation notice.
|
||||
olMeetingRequest = 53, // Represents a MeetingItem object that is a meeting request.
|
||||
olMeetingResponseNegative = 55, // Represents a MeetingItem object that is a refusal of a meeting request.
|
||||
olMeetingResponsePositive = 56, // Represents a MeetingItem object that is an acceptance of a meeting request.
|
||||
olMeetingResponseTentative = 57, // Represents a MeetingItem object that is a tentative acceptance of a meeting request.
|
||||
olMoveOrCopyRuleAction = 118, // Represents a MoveOrCopyRuleAction object.
|
||||
olNamespace = 1, // Represents a NameSpace object.
|
||||
olNavigationFolder = 167, // Represents a NavigationFolder object.
|
||||
olNavigationFolders = 166, // Represents a NavigationFolders object.
|
||||
olNavigationGroup = 165, // Represents a NavigationGroup object.
|
||||
olNavigationGroups = 164, // Represents a NavigationGroups object.
|
||||
olNavigationModule = 157, // Represents a NavigationModule object.
|
||||
olNavigationModules = 156, // Represents a NavigationModules object.
|
||||
olNewItemAlertRuleAction = 125, // Represents a NewItemAlertRuleAction object.
|
||||
olNote = 44, // Represents a NoteItem object.
|
||||
olNotesModule = 163, // Represents a NotesModule object.
|
||||
olOrderField = 144, // Represents an OrderField object.
|
||||
olOrderFields = 145, // Represents an OrderFields object.
|
||||
olOutlookBarGroup = 66, // Represents an OutlookBarGroup object.
|
||||
olOutlookBarGroups = 65, // Represents an OutlookBarGroups object.
|
||||
olOutlookBarPane = 63, // Represents an OutlookBarPane object.
|
||||
olOutlookBarShortcut = 68, // Represents an OutlookBarShortcut object.
|
||||
olOutlookBarShortcuts = 67, // Represents an OutlookBarShortcuts object.
|
||||
olOutlookBarStorage = 64, // Represents an OutlookBarStorage object.
|
||||
olPages = 36, // Represents a Pages object.
|
||||
olPanes = 62, // Represents a Panes object.
|
||||
olPlaySoundRuleAction = 123, // Represents a PlaySoundRuleAction object.
|
||||
olPost = 45, // Represents a PostItem object.
|
||||
olPropertyAccessor = 112, // Represents a PropertyAccessor object.
|
||||
olPropertyPages = 71, // Represents a PropertyPages object.
|
||||
olPropertyPageSite = 70, // Represents a PropertyPageSite object.
|
||||
olRecipient = 4, // Represents a Recipient object.
|
||||
olRecipients = 17, // Represents a Recipients object.
|
||||
olRecurrencePattern = 28, // Represents a RecurrencePattern object.
|
||||
olReminder = 101, // Represents a Reminder object.
|
||||
olReminders = 100, // Represents a Reminders object.
|
||||
olRemote = 47, // Represents a RemoteItem object.
|
||||
olReport = 46, // Represents a ReportItem object.
|
||||
olResults = 78, // Represents a Results object.
|
||||
olRow = 121, // Represents a Row object.
|
||||
olRule = 115, // Represents a Rule object.
|
||||
olRuleAction = 117, // Represents a RuleAction object.
|
||||
olRuleActions = 116, // Represents a RuleAction object.
|
||||
olRuleCondition = 127, // Represents a RuleCondition object.
|
||||
olRuleConditions = 126, // Represents a RuleConditions object.
|
||||
olRules = 114, // Represents a Rules object.
|
||||
olSearch = 77, // Represents a Search object.
|
||||
olSelection = 74, // Represents a Selection object.
|
||||
olSelectNamesDialog = 109, // Represents a SelectNamesDialog object.
|
||||
olSenderInAddressListRuleCondition = 133, // Represents a SenderInAddressListRuleCondition object.
|
||||
olSendRuleAction = 119, // Represents a SendRuleAction object.
|
||||
olSharing = 104, // Represents a SharingItem object.
|
||||
olStorageItem = 113, // Represents a StorageItem object.
|
||||
olStore = 107, // Represents a Store object.
|
||||
olStores = 108, // Represents a Stores object.
|
||||
olSyncObject = 72, // Represents a SyncObject object.
|
||||
olSyncObjects = 73, // Represents a SyncObject object.
|
||||
olTable = 120, // Represents a Table object.
|
||||
olTask = 48, // Represents a TaskItem object.
|
||||
olTaskRequest = 49, // Represents a TaskRequestItem object.
|
||||
olTaskRequestAccept = 51, // Represents a TaskRequestAcceptItem object.
|
||||
olTaskRequestDecline = 52, // Represents a TaskRequestDeclineItem object.
|
||||
olTaskRequestUpdate = 50, // Represents a TaskRequestUpdateItem object.
|
||||
olTasksModule = 161, // Represents a TasksModule object.
|
||||
olTextRuleCondition = 134, // Represents a TextRuleCondition object.
|
||||
olUserDefinedProperties = 172, // Represents a UserDefinedProperties object.
|
||||
olUserDefinedProperty = 171, // Represents a UserDefinedProperty object.
|
||||
olUserProperties = 38, // Represents a UserProperties object.
|
||||
olUserProperty = 39, // Represents a UserProperty object.
|
||||
olView = 80, // Represents a View object.
|
||||
olViewField = 142, // Represents a ViewField object.
|
||||
olViewFields = 141, // Represents a ViewFields object.
|
||||
olViewFont = 146, // Represents a ViewFont object.
|
||||
olViews = 79 // Represents a Views object.
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlReoccurenceState
|
||||
{
|
||||
olApptException,
|
||||
olApptMaster,
|
||||
olApptNotRecurring,
|
||||
olApptOccurrence
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlSensitivity
|
||||
{
|
||||
// Fields
|
||||
olConfidential = 3,
|
||||
olNormal = 0,
|
||||
olPersonal = 1,
|
||||
olPrivate = 2
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum OlWindowState
|
||||
{
|
||||
// Fields
|
||||
olMaximized = 0,
|
||||
olMinimized = 1,
|
||||
olNormalWindow = 2
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public class OneNoteNotebook
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string ID { get; set; }
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public class OneNotePage
|
||||
{
|
||||
public OneNoteSection Parent { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string ID { get; set; }
|
||||
public bool IsCurrentlyViewed { get; set; }
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get
|
||||
{
|
||||
var notebook = Parent.Parent;
|
||||
if (string.IsNullOrEmpty(notebook.Name))
|
||||
{
|
||||
return string.Format("{0} / {1}", Parent.Name, Name);
|
||||
}
|
||||
return string.Format("{0} / {1} / {2}", Parent.Parent.Name, Parent.Name, Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public class OneNoteSection
|
||||
{
|
||||
public OneNoteNotebook Parent { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string ID { get; set; }
|
||||
}
|
||||
}
|
@ -1,884 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dapplo.Log;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
internal enum PT : uint
|
||||
{
|
||||
PT_UNSPECIFIED = 0, /* (Reserved for interface use) type doesn't matter to caller */
|
||||
PT_NULL = 1, /* NULL property value */
|
||||
PT_I2 = 2, /* Signed 16-bit value */
|
||||
PT_LONG = 3, /* Signed 32-bit value */
|
||||
PT_R4 = 4, /* 4-byte floating point */
|
||||
PT_DOUBLE = 5, /* Floating point double */
|
||||
PT_CURRENCY = 6, /* Signed 64-bit int (decimal w/ 4 digits right of decimal pt) */
|
||||
PT_APPTIME = 7, /* Application time */
|
||||
PT_ERROR = 10, /* 32-bit error value */
|
||||
PT_BOOLEAN = 11, /* 16-bit boolean (non-zero true, */
|
||||
// Use PT_BOOLEAN_DESKTOP to be specific instead of using PT_BOOLEAN which is mapped to 2 in addrmapi.h
|
||||
PT_BOOLEAN_DESKTOP = 11, /* 16-bit boolean (non-zero true) */
|
||||
PT_OBJECT = 13, /* Embedded object in a property */
|
||||
PT_I8 = 20, /* 8-byte signed integer */
|
||||
PT_STRING8 = 30, /* Null terminated 8-bit character string */
|
||||
PT_UNICODE = 31, /* Null terminated Unicode string */
|
||||
PT_SYSTIME = 64, /* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */
|
||||
PT_CLSID = 72, /* OLE GUID */
|
||||
PT_BINARY = 258, /* Uninterpreted (counted byte array) */
|
||||
|
||||
PT_TSTRING = PT_UNICODE
|
||||
}
|
||||
|
||||
public enum PropTags : uint
|
||||
{
|
||||
PR_ERROR = 10,
|
||||
|
||||
// Common non-transmittable
|
||||
PR_ENTRYID = PT.PT_BINARY | (0x0FFF << 16),
|
||||
PR_OBJECT_TYPE = PT.PT_LONG | (0x0FFE << 16),
|
||||
PR_ICON = PT.PT_BINARY | (0x0FFD << 16),
|
||||
PR_MINI_ICON = PT.PT_BINARY | (0x0FFC << 16),
|
||||
PR_STORE_ENTRYID = PT.PT_BINARY | (0x0FFB << 16),
|
||||
PR_STORE_RECORD_KEY = PT.PT_BINARY | (0x0FFA << 16),
|
||||
PR_RECORD_KEY = PT.PT_BINARY | (0x0FF9 << 16),
|
||||
PR_MAPPING_SIGNATURE = PT.PT_BINARY | (0x0FF8 << 16),
|
||||
PR_ACCESS_LEVEL = PT.PT_LONG | (0x0FF7 << 16),
|
||||
PR_INSTANCE_KEY = PT.PT_BINARY | (0x0FF6 << 16),
|
||||
PR_ROW_TYPE = PT.PT_LONG | (0x0FF5 << 16),
|
||||
PR_ACCESS = PT.PT_LONG | (0x0FF4 << 16),
|
||||
|
||||
// Common transmittable
|
||||
PR_ROWID = PT.PT_LONG | (0x3000 << 16),
|
||||
PR_DISPLAY_NAME = PT.PT_TSTRING | (0x3001 << 16),
|
||||
PR_DISPLAY_NAME_W = PT.PT_UNICODE | (0x3001 << 16),
|
||||
PR_DISPLAY_NAME_A = PT.PT_STRING8 | (0x3001 << 16),
|
||||
PR_ADDRTYPE = PT.PT_TSTRING | (0x3002 << 16),
|
||||
PR_ADDRTYPE_W = PT.PT_UNICODE | (0x3002 << 16),
|
||||
PR_ADDRTYPE_A = PT.PT_STRING8 | (0x3002 << 16),
|
||||
PR_EMAIL_ADDRESS = PT.PT_TSTRING | (0x3003 << 16),
|
||||
PR_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x3003 << 16),
|
||||
PR_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x3003 << 16),
|
||||
PR_COMMENT = PT.PT_TSTRING | (0x3004 << 16),
|
||||
PR_COMMENT_W = PT.PT_UNICODE | (0x3004 << 16),
|
||||
PR_COMMENT_A = PT.PT_STRING8 | (0x3004 << 16),
|
||||
PR_DEPTH = PT.PT_LONG | (0x3005 << 16),
|
||||
PR_PROVIDER_DISPLAY = PT.PT_TSTRING | (0x3006 << 16),
|
||||
PR_PROVIDER_DISPLAY_W = PT.PT_UNICODE | (0x3006 << 16),
|
||||
PR_PROVIDER_DISPLAY_A = PT.PT_STRING8 | (0x3006 << 16),
|
||||
PR_CREATION_TIME = PT.PT_SYSTIME | (0x3007 << 16),
|
||||
PR_LAST_MODIFICATION_TIME = PT.PT_SYSTIME | (0x3008 << 16),
|
||||
PR_RESOURCE_FLAGS = PT.PT_LONG | (0x3009 << 16),
|
||||
PR_PROVIDER_DLL_NAME = PT.PT_TSTRING | (0x300A << 16),
|
||||
PR_PROVIDER_DLL_NAME_W = PT.PT_UNICODE | (0x300A << 16),
|
||||
PR_PROVIDER_DLL_NAME_A = PT.PT_STRING8 | (0x300A << 16),
|
||||
PR_SEARCH_KEY = PT.PT_BINARY | (0x300B << 16),
|
||||
PR_PROVIDER_UID = PT.PT_BINARY | (0x300C << 16),
|
||||
PR_PROVIDER_ORDINAL = PT.PT_LONG | (0x300D << 16),
|
||||
|
||||
// Message store specific
|
||||
PR_DEFAULT_STORE = PT.PT_BOOLEAN | (0x3400 << 16),
|
||||
PR_STORE_SUPPORT_MASK = PT.PT_LONG | (0x340D << 16),
|
||||
PR_STORE_STATE = PT.PT_LONG | (0x340E << 16),
|
||||
|
||||
PR_IPM_SUBTREE_SEARCH_KEY = PT.PT_BINARY | (0x3410 << 16),
|
||||
PR_IPM_OUTBOX_SEARCH_KEY = PT.PT_BINARY | (0x3411 << 16),
|
||||
PR_IPM_WASTEBASKET_SEARCH_KEY = PT.PT_BINARY | (0x3412 << 16),
|
||||
PR_IPM_SENTMAIL_SEARCH_KEY = PT.PT_BINARY | (0x3413 << 16),
|
||||
PR_MDB_PROVIDER = PT.PT_BINARY | (0x3414 << 16),
|
||||
PR_RECEIVE_FOLDER_SETTINGS = PT.PT_OBJECT | (0x3415 << 16),
|
||||
|
||||
PR_VALID_FOLDER_MASK = PT.PT_LONG | (0x35DF << 16),
|
||||
PR_IPM_SUBTREE_ENTRYID = PT.PT_BINARY | (0x35E0 << 16),
|
||||
|
||||
PR_IPM_OUTBOX_ENTRYID = PT.PT_BINARY | (0x35E2 << 16),
|
||||
PR_IPM_WASTEBASKET_ENTRYID = PT.PT_BINARY | (0x35E3 << 16),
|
||||
PR_IPM_SENTMAIL_ENTRYID = PT.PT_BINARY | (0x35E4 << 16),
|
||||
PR_VIEWS_ENTRYID = PT.PT_BINARY | (0x35E5 << 16),
|
||||
PR_COMMON_VIEWS_ENTRYID = PT.PT_BINARY | (0x35E6 << 16),
|
||||
PR_FINDER_ENTRYID = PT.PT_BINARY | (0x35E7 << 16),
|
||||
PR_ATTACH_CONTENT_ID = PT.PT_TSTRING | (0x3712 << 16),
|
||||
PR_ATTACH_CONTENT_ID_A = PT.PT_STRING8 | (0x3712 << 16),
|
||||
PR_ATTACH_CONTENT_ID_W = PT.PT_TSTRING | (0x3712 << 16),
|
||||
PR_ATTACH_CONTENT_LOCATION = PT.PT_TSTRING | (0x3713 << 16),
|
||||
PR_ATTACH_CONTENT_LOCATION_A = PT.PT_STRING8 | (0x3713 << 16),
|
||||
PR_ATTACH_CONTENT_LOCATION_W = PT.PT_TSTRING | (0x3713 << 16),
|
||||
|
||||
// Message non-transmittable properties
|
||||
PR_CURRENT_VERSION = PT.PT_I8 | (0x0E00 << 16),
|
||||
PR_DELETE_AFTER_SUBMIT = PT.PT_BOOLEAN | (0x0E01 << 16),
|
||||
PR_DISPLAY_BCC = PT.PT_TSTRING | (0x0E02 << 16),
|
||||
PR_DISPLAY_BCC_W = PT.PT_UNICODE | (0x0E02 << 16),
|
||||
PR_DISPLAY_BCC_A = PT.PT_STRING8 | (0x0E02 << 16),
|
||||
PR_DISPLAY_CC = PT.PT_TSTRING | (0x0E03 << 16),
|
||||
PR_DISPLAY_CC_W = PT.PT_UNICODE | (0x0E03 << 16),
|
||||
PR_DISPLAY_CC_A = PT.PT_STRING8 | (0x0E03 << 16),
|
||||
PR_DISPLAY_TO = PT.PT_TSTRING | (0x0E04 << 16),
|
||||
PR_DISPLAY_TO_W = PT.PT_UNICODE | (0x0E04 << 16),
|
||||
PR_DISPLAY_TO_A = PT.PT_STRING8 | (0x0E04 << 16),
|
||||
PR_PARENT_DISPLAY = PT.PT_TSTRING | (0x0E05 << 16),
|
||||
PR_PARENT_DISPLAY_W = PT.PT_UNICODE | (0x0E05 << 16),
|
||||
PR_PARENT_DISPLAY_A = PT.PT_STRING8 | (0x0E05 << 16),
|
||||
PR_MESSAGE_DELIVERY_TIME = PT.PT_SYSTIME | (0x0E06 << 16),
|
||||
PR_MESSAGE_FLAGS = PT.PT_LONG | (0x0E07 << 16),
|
||||
PR_MESSAGE_SIZE = PT.PT_LONG | (0x0E08 << 16),
|
||||
PR_PARENT_ENTRYID = PT.PT_BINARY | (0x0E09 << 16),
|
||||
PR_SENTMAIL_ENTRYID = PT.PT_BINARY | (0x0E0A << 16),
|
||||
PR_CORRELATE = PT.PT_BOOLEAN | (0x0E0C << 16),
|
||||
PR_CORRELATE_MTSID = PT.PT_BINARY | (0x0E0D << 16),
|
||||
PR_DISCRETE_VALUES = PT.PT_BOOLEAN | (0x0E0E << 16),
|
||||
PR_RESPONSIBILITY = PT.PT_BOOLEAN | (0x0E0F << 16),
|
||||
PR_SPOOLER_STATUS = PT.PT_LONG | (0x0E10 << 16),
|
||||
PR_TRANSPORT_STATUS = PT.PT_LONG | (0x0E11 << 16),
|
||||
PR_MESSAGE_RECIPIENTS = PT.PT_OBJECT | (0x0E12 << 16),
|
||||
PR_MESSAGE_ATTACHMENTS = PT.PT_OBJECT | (0x0E13 << 16),
|
||||
PR_SUBMIT_FLAGS = PT.PT_LONG | (0x0E14 << 16),
|
||||
PR_RECIPIENT_STATUS = PT.PT_LONG | (0x0E15 << 16),
|
||||
PR_TRANSPORT_KEY = PT.PT_LONG | (0x0E16 << 16),
|
||||
PR_MSG_STATUS = PT.PT_LONG | (0x0E17 << 16),
|
||||
PR_MESSAGE_DOWNLOAD_TIME = PT.PT_LONG | (0x0E18 << 16),
|
||||
PR_CREATION_VERSION = PT.PT_I8 | (0x0E19 << 16),
|
||||
PR_MODIFY_VERSION = PT.PT_I8 | (0x0E1A << 16),
|
||||
PR_HASATTACH = PT.PT_BOOLEAN | (0x0E1B << 16),
|
||||
PR_BODY_CRC = PT.PT_LONG | (0x0E1C << 16),
|
||||
PR_NORMALIZED_SUBJECT = PT.PT_TSTRING | (0x0E1D << 16),
|
||||
PR_NORMALIZED_SUBJECT_W = PT.PT_UNICODE | (0x0E1D << 16),
|
||||
PR_NORMALIZED_SUBJECT_A = PT.PT_STRING8 | (0x0E1D << 16),
|
||||
PR_RTF_IN_SYNC = PT.PT_BOOLEAN | (0x0E1F << 16),
|
||||
PR_ATTACH_SIZE = PT.PT_LONG | (0x0E20 << 16),
|
||||
PR_ATTACH_NUM = PT.PT_LONG | (0x0E21 << 16),
|
||||
PR_PREPROCESS = PT.PT_BOOLEAN | (0x0E22 << 16),
|
||||
|
||||
// Message recipient properties
|
||||
PR_CONTENT_INTEGRITY_CHECK = PT.PT_BINARY | (0x0C00 << 16),
|
||||
PR_EXPLICIT_CONVERSION = PT.PT_LONG | (0x0C01 << 16),
|
||||
PR_IPM_RETURN_REQUESTED = PT.PT_BOOLEAN | (0x0C02 << 16),
|
||||
PR_MESSAGE_TOKEN = PT.PT_BINARY | (0x0C03 << 16),
|
||||
PR_NDR_REASON_CODE = PT.PT_LONG | (0x0C04 << 16),
|
||||
PR_NDR_DIAG_CODE = PT.PT_LONG | (0x0C05 << 16),
|
||||
PR_NON_RECEIPT_NOTIFICATION_REQUESTED = PT.PT_BOOLEAN | (0x0C06 << 16),
|
||||
PR_DELIVERY_POINT = PT.PT_LONG | (0x0C07 << 16),
|
||||
|
||||
PR_ORIGINATOR_NON_DELIVERY_REPORT_REQUESTED = PT.PT_BOOLEAN | (0x0C08 << 16),
|
||||
PR_ORIGINATOR_REQUESTED_ALTERNATE_RECIPIENT = PT.PT_BINARY | (0x0C09 << 16),
|
||||
PR_PHYSICAL_DELIVERY_BUREAU_FAX_DELIVERY = PT.PT_BOOLEAN | (0x0C0A << 16),
|
||||
PR_PHYSICAL_DELIVERY_MODE = PT.PT_LONG | (0x0C0B << 16),
|
||||
PR_PHYSICAL_DELIVERY_REPORT_REQUEST = PT.PT_LONG | (0x0C0C << 16),
|
||||
PR_PHYSICAL_FORWARDING_ADDRESS = PT.PT_BINARY | (0x0C0D << 16),
|
||||
PR_PHYSICAL_FORWARDING_ADDRESS_REQUESTED = PT.PT_BOOLEAN | (0x0C0E << 16),
|
||||
PR_PHYSICAL_FORWARDING_PROHIBITED = PT.PT_BOOLEAN | (0x0C0F << 16),
|
||||
PR_PHYSICAL_RENDITION_ATTRIBUTES = PT.PT_BINARY | (0x0C10 << 16),
|
||||
PR_PROOF_OF_DELIVERY = PT.PT_BINARY | (0x0C11 << 16),
|
||||
PR_PROOF_OF_DELIVERY_REQUESTED = PT.PT_BOOLEAN | (0x0C12 << 16),
|
||||
PR_RECIPIENT_CERTIFICATE = PT.PT_BINARY | (0x0C13 << 16),
|
||||
PR_RECIPIENT_NUMBER_FOR_ADVICE = PT.PT_TSTRING | (0x0C14 << 16),
|
||||
PR_RECIPIENT_NUMBER_FOR_ADVICE_W = PT.PT_UNICODE | (0x0C14 << 16),
|
||||
PR_RECIPIENT_NUMBER_FOR_ADVICE_A = PT.PT_STRING8 | (0x0C14 << 16),
|
||||
PR_RECIPIENT_TYPE = PT.PT_LONG | (0x0C15 << 16),
|
||||
PR_REGISTERED_MAIL_TYPE = PT.PT_LONG | (0x0C16 << 16),
|
||||
PR_REPLY_REQUESTED = PT.PT_BOOLEAN | (0x0C17 << 16),
|
||||
//PR_REQUESTED_DELIVERY_METHOD = PT.PT_LONG | 0x0C18 << 16,
|
||||
PR_SENDER_ENTRYID = PT.PT_BINARY | (0x0C19 << 16),
|
||||
PR_SENDER_NAME = PT.PT_TSTRING | (0x0C1A << 16),
|
||||
PR_SENDER_NAME_W = PT.PT_UNICODE | (0x0C1A << 16),
|
||||
PR_SENDER_NAME_A = PT.PT_STRING8 | (0x0C1A << 16),
|
||||
PR_SUPPLEMENTARY_INFO = PT.PT_TSTRING | (0x0C1B << 16),
|
||||
PR_SUPPLEMENTARY_INFO_W = PT.PT_UNICODE | (0x0C1B << 16),
|
||||
PR_SUPPLEMENTARY_INFO_A = PT.PT_STRING8 | (0x0C1B << 16),
|
||||
PR_TYPE_OF_MTS_USER = PT.PT_LONG | (0x0C1C << 16),
|
||||
PR_SENDER_SEARCH_KEY = PT.PT_BINARY | (0x0C1D << 16),
|
||||
PR_SENDER_ADDRTYPE = PT.PT_TSTRING | (0x0C1E << 16),
|
||||
PR_SENDER_ADDRTYPE_W = PT.PT_UNICODE | (0x0C1E << 16),
|
||||
PR_SENDER_ADDRTYPE_A = PT.PT_STRING8 | (0x0C1E << 16),
|
||||
PR_SENDER_EMAIL_ADDRESS = PT.PT_TSTRING | (0x0C1F << 16),
|
||||
PR_SENDER_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x0C1F << 16),
|
||||
PR_SENDER_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x0C1F << 16),
|
||||
|
||||
// Message envelope properties
|
||||
PR_ACKNOWLEDGEMENT_MODE = PT.PT_LONG | (0x0001 << 16),
|
||||
PR_ALTERNATE_RECIPIENT_ALLOWED = PT.PT_BOOLEAN | (0x0002 << 16),
|
||||
PR_AUTHORIZING_USERS = PT.PT_BINARY | (0x0003 << 16),
|
||||
PR_AUTO_FORWARD_COMMENT = PT.PT_TSTRING | (0x0004 << 16),
|
||||
PR_AUTO_FORWARD_COMMENT_W = PT.PT_UNICODE | (0x0004 << 16),
|
||||
PR_AUTO_FORWARD_COMMENT_A = PT.PT_STRING8 | (0x0004 << 16),
|
||||
PR_AUTO_FORWARDED = PT.PT_BOOLEAN | (0x0005 << 16),
|
||||
PR_CONTENT_CONFIDENTIALITY_ALGORITHM_ID = PT.PT_BINARY | (0x0006 << 16),
|
||||
PR_CONTENT_CORRELATOR = PT.PT_BINARY | (0x0007 << 16),
|
||||
PR_CONTENT_IDENTIFIER = PT.PT_TSTRING | (0x0008 << 16),
|
||||
PR_CONTENT_IDENTIFIER_W = PT.PT_UNICODE | (0x0008 << 16),
|
||||
PR_CONTENT_IDENTIFIER_A = PT.PT_STRING8 | (0x0008 << 16),
|
||||
PR_CONTENT_LENGTH = PT.PT_LONG | (0x0009 << 16),
|
||||
PR_CONTENT_RETURN_REQUESTED = PT.PT_BOOLEAN | (0x000A << 16),
|
||||
|
||||
// Message envelope properties
|
||||
PR_CONVERSATION_KEY = PT.PT_BINARY | (0x000B << 16),
|
||||
|
||||
PR_CONVERSION_EITS = PT.PT_BINARY | (0x000C << 16),
|
||||
PR_CONVERSION_WITH_LOSS_PROHIBITED = PT.PT_BOOLEAN | (0x000D << 16),
|
||||
PR_CONVERTED_EITS = PT.PT_BINARY | (0x000E << 16),
|
||||
PR_DEFERRED_DELIVERY_TIME = PT.PT_SYSTIME | (0x000F << 16),
|
||||
PR_DELIVER_TIME = PT.PT_SYSTIME | (0x0010 << 16),
|
||||
PR_DISCARD_REASON = PT.PT_LONG | (0x0011 << 16),
|
||||
PR_DISCLOSURE_OF_RECIPIENTS = PT.PT_BOOLEAN | (0x0012 << 16),
|
||||
PR_DL_EXPANSION_HISTORY = PT.PT_BINARY | (0x0013 << 16),
|
||||
PR_DL_EXPANSION_PROHIBITED = PT.PT_BOOLEAN | (0x0014 << 16),
|
||||
PR_EXPIRY_TIME = PT.PT_SYSTIME | (0x0015 << 16),
|
||||
PR_IMPLICIT_CONVERSION_PROHIBITED = PT.PT_BOOLEAN | (0x0016 << 16),
|
||||
PR_IMPORTANCE = PT.PT_LONG | (0x0017 << 16),
|
||||
PR_IPM_ID = PT.PT_BINARY | (0x0018 << 16),
|
||||
PR_LATEST_DELIVERY_TIME = PT.PT_SYSTIME | (0x0019 << 16),
|
||||
PR_MESSAGE_CLASS = PT.PT_TSTRING | (0x001A << 16),
|
||||
PR_MESSAGE_CLASS_W = PT.PT_UNICODE | (0x001A << 16),
|
||||
PR_MESSAGE_CLASS_A = PT.PT_STRING8 | (0x001A << 16),
|
||||
PR_MESSAGE_DELIVERY_ID = PT.PT_BINARY | (0x001B << 16),
|
||||
|
||||
PR_MESSAGE_SECURITY_LABEL = PT.PT_BINARY | (0x001E << 16),
|
||||
PR_OBSOLETED_IPMS = PT.PT_BINARY | (0x001F << 16),
|
||||
PR_ORIGINALLY_INTENDED_RECIPIENT_NAME = PT.PT_BINARY | (0x0020 << 16),
|
||||
PR_ORIGINAL_EITS = PT.PT_BINARY | (0x0021 << 16),
|
||||
PR_ORIGINATOR_CERTIFICATE = PT.PT_BINARY | (0x0022 << 16),
|
||||
PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED = PT.PT_BOOLEAN | (0x0023 << 16),
|
||||
PR_ORIGINATOR_RETURN_ADDRESS = PT.PT_BINARY | (0x0024 << 16),
|
||||
|
||||
PR_PARENT_KEY = PT.PT_BINARY | (0x0025 << 16),
|
||||
PR_PRIORITY = PT.PT_LONG | (0x0026 << 16),
|
||||
|
||||
PR_ORIGIN_CHECK = PT.PT_BINARY | (0x0027 << 16),
|
||||
PR_PROOF_OF_SUBMISSION_REQUESTED = PT.PT_BOOLEAN | (0x0028 << 16),
|
||||
PR_READ_RECEIPT_REQUESTED = PT.PT_BOOLEAN | (0x0029 << 16),
|
||||
PR_RECEIPT_TIME = PT.PT_SYSTIME | (0x002A << 16),
|
||||
PR_RECIPIENT_REASSIGNMENT_PROHIBITED = PT.PT_BOOLEAN | (0x002B << 16),
|
||||
PR_REDIRECTION_HISTORY = PT.PT_BINARY | (0x002C << 16),
|
||||
PR_RELATED_IPMS = PT.PT_BINARY | (0x002D << 16),
|
||||
PR_ORIGINAL_SENSITIVITY = PT.PT_LONG | (0x002E << 16),
|
||||
PR_LANGUAGES = PT.PT_TSTRING | (0x002F << 16),
|
||||
PR_LANGUAGES_W = PT.PT_UNICODE | (0x002F << 16),
|
||||
PR_LANGUAGES_A = PT.PT_STRING8 | (0x002F << 16),
|
||||
PR_REPLY_TIME = PT.PT_SYSTIME | (0x0030 << 16),
|
||||
PR_REPORT_TAG = PT.PT_BINARY | (0x0031 << 16),
|
||||
PR_REPORT_TIME = PT.PT_SYSTIME | (0x0032 << 16),
|
||||
PR_RETURNED_IPM = PT.PT_BOOLEAN | (0x0033 << 16),
|
||||
PR_SECURITY = PT.PT_LONG | (0x0034 << 16),
|
||||
PR_INCOMPLETE_COPY = PT.PT_BOOLEAN | (0x0035 << 16),
|
||||
PR_SENSITIVITY = PT.PT_LONG | (0x0036 << 16),
|
||||
PR_SUBJECT = PT.PT_TSTRING | (0x0037 << 16),
|
||||
PR_SUBJECT_W = PT.PT_UNICODE | (0x0037 << 16),
|
||||
PR_SUBJECT_A = PT.PT_STRING8 | (0x0037 << 16),
|
||||
PR_SUBJECT_IPM = PT.PT_BINARY | (0x0038 << 16),
|
||||
PR_CLIENT_SUBMIT_TIME = PT.PT_SYSTIME | (0x0039 << 16),
|
||||
PR_REPORT_NAME = PT.PT_TSTRING | (0x003A << 16),
|
||||
PR_REPORT_NAME_W = PT.PT_UNICODE | (0x003A << 16),
|
||||
PR_REPORT_NAME_A = PT.PT_STRING8 | (0x003A << 16),
|
||||
PR_SENT_REPRESENTING_SEARCH_KEY = PT.PT_BINARY | (0x003B << 16),
|
||||
PR_X400_CONTENT_TYPE = PT.PT_BINARY | (0x003C << 16),
|
||||
PR_SUBJECT_PREFIX = PT.PT_TSTRING | (0x003D << 16),
|
||||
PR_SUBJECT_PREFIX_W = PT.PT_UNICODE | (0x003D << 16),
|
||||
PR_SUBJECT_PREFIX_A = PT.PT_STRING8 | (0x003D << 16),
|
||||
PR_NON_RECEIPT_REASON = PT.PT_LONG | (0x003E << 16),
|
||||
PR_RECEIVED_BY_ENTRYID = PT.PT_BINARY | (0x003F << 16),
|
||||
PR_RECEIVED_BY_NAME = PT.PT_TSTRING | (0x0040 << 16),
|
||||
PR_RECEIVED_BY_NAME_W = PT.PT_UNICODE | (0x0040 << 16),
|
||||
PR_RECEIVED_BY_NAME_A = PT.PT_STRING8 | (0x0040 << 16),
|
||||
PR_SENT_REPRESENTING_ENTRYID = PT.PT_BINARY | (0x0041 << 16),
|
||||
PR_SENT_REPRESENTING_NAME = PT.PT_TSTRING | (0x0042 << 16),
|
||||
PR_SENT_REPRESENTING_NAME_W = PT.PT_UNICODE | (0x0042 << 16),
|
||||
PR_SENT_REPRESENTING_NAME_A = PT.PT_STRING8 | (0x0042 << 16),
|
||||
PR_RCVD_REPRESENTING_ENTRYID = PT.PT_BINARY | (0x0043 << 16),
|
||||
PR_RCVD_REPRESENTING_NAME = PT.PT_TSTRING | (0x0044 << 16),
|
||||
PR_RCVD_REPRESENTING_NAME_W = PT.PT_UNICODE | (0x0044 << 16),
|
||||
PR_RCVD_REPRESENTING_NAME_A = PT.PT_STRING8 | (0x0044 << 16),
|
||||
PR_REPORT_ENTRYID = PT.PT_BINARY | (0x0045 << 16),
|
||||
PR_READ_RECEIPT_ENTRYID = PT.PT_BINARY | (0x0046 << 16),
|
||||
PR_MESSAGE_SUBMISSION_ID = PT.PT_BINARY | (0x0047 << 16),
|
||||
PR_PROVIDER_SUBMIT_TIME = PT.PT_SYSTIME | (0x0048 << 16),
|
||||
PR_ORIGINAL_SUBJECT = PT.PT_TSTRING | (0x0049 << 16),
|
||||
PR_ORIGINAL_SUBJECT_W = PT.PT_UNICODE | (0x0049 << 16),
|
||||
PR_ORIGINAL_SUBJECT_A = PT.PT_STRING8 | (0x0049 << 16),
|
||||
PR_DISC_VAL = PT.PT_BOOLEAN | (0x004A << 16),
|
||||
PR_ORIG_MESSAGE_CLASS = PT.PT_TSTRING | (0x004B << 16),
|
||||
PR_ORIG_MESSAGE_CLASS_W = PT.PT_UNICODE | (0x004B << 16),
|
||||
PR_ORIG_MESSAGE_CLASS_A = PT.PT_STRING8 | (0x004B << 16),
|
||||
PR_ORIGINAL_AUTHOR_ENTRYID = PT.PT_BINARY | (0x004C << 16),
|
||||
PR_ORIGINAL_AUTHOR_NAME = PT.PT_TSTRING | (0x004D << 16),
|
||||
PR_ORIGINAL_AUTHOR_NAME_W = PT.PT_UNICODE | (0x004D << 16),
|
||||
PR_ORIGINAL_AUTHOR_NAME_A = PT.PT_STRING8 | (0x004D << 16),
|
||||
PR_ORIGINAL_SUBMIT_TIME = PT.PT_SYSTIME | (0x004E << 16),
|
||||
PR_REPLY_RECIPIENT_ENTRIES = PT.PT_BINARY | (0x004F << 16),
|
||||
PR_REPLY_RECIPIENT_NAMES = PT.PT_TSTRING | (0x0050 << 16),
|
||||
PR_REPLY_RECIPIENT_NAMES_W = PT.PT_UNICODE | (0x0050 << 16),
|
||||
PR_REPLY_RECIPIENT_NAMES_A = PT.PT_STRING8 | (0x0050 << 16),
|
||||
|
||||
PR_RECEIVED_BY_SEARCH_KEY = PT.PT_BINARY | (0x0051 << 16),
|
||||
PR_RCVD_REPRESENTING_SEARCH_KEY = PT.PT_BINARY | (0x0052 << 16),
|
||||
PR_READ_RECEIPT_SEARCH_KEY = PT.PT_BINARY | (0x0053 << 16),
|
||||
PR_REPORT_SEARCH_KEY = PT.PT_BINARY | (0x0054 << 16),
|
||||
PR_ORIGINAL_DELIVERY_TIME = PT.PT_SYSTIME | (0x0055 << 16),
|
||||
PR_ORIGINAL_AUTHOR_SEARCH_KEY = PT.PT_BINARY | (0x0056 << 16),
|
||||
|
||||
PR_MESSAGE_TO_ME = PT.PT_BOOLEAN | (0x0057 << 16),
|
||||
PR_MESSAGE_CC_ME = PT.PT_BOOLEAN | (0x0058 << 16),
|
||||
PR_MESSAGE_RECIP_ME = PT.PT_BOOLEAN | (0x0059 << 16),
|
||||
|
||||
PR_ORIGINAL_SENDER_NAME = PT.PT_TSTRING | (0x005A << 16),
|
||||
PR_ORIGINAL_SENDER_NAME_W = PT.PT_UNICODE | (0x005A << 16),
|
||||
PR_ORIGINAL_SENDER_NAME_A = PT.PT_STRING8 | (0x005A << 16),
|
||||
PR_ORIGINAL_SENDER_ENTRYID = PT.PT_BINARY | (0x005B << 16),
|
||||
PR_ORIGINAL_SENDER_SEARCH_KEY = PT.PT_BINARY | (0x005C << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_NAME = PT.PT_TSTRING | (0x005D << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_NAME_W = PT.PT_UNICODE | (0x005D << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_NAME_A = PT.PT_STRING8 | (0x005D << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_ENTRYID = PT.PT_BINARY | (0x005E << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_SEARCH_KEY = PT.PT_BINARY | (0x005F << 16),
|
||||
|
||||
PR_START_DATE = PT.PT_SYSTIME | (0x0060 << 16),
|
||||
PR_END_DATE = PT.PT_SYSTIME | (0x0061 << 16),
|
||||
PR_OWNER_APPT_ID = PT.PT_LONG | (0x0062 << 16),
|
||||
//PR_RESPONSE_REQUESTED = PT.PT_BOOLEAN | 0x0063 << 16,
|
||||
|
||||
PR_SENT_REPRESENTING_ADDRTYPE = PT.PT_TSTRING | (0x0064 << 16),
|
||||
PR_SENT_REPRESENTING_ADDRTYPE_W = PT.PT_UNICODE | (0x0064 << 16),
|
||||
PR_SENT_REPRESENTING_ADDRTYPE_A = PT.PT_STRING8 | (0x0064 << 16),
|
||||
PR_SENT_REPRESENTING_EMAIL_ADDRESS = PT.PT_TSTRING | (0x0065 << 16),
|
||||
PR_SENT_REPRESENTING_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x0065 << 16),
|
||||
PR_SENT_REPRESENTING_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x0065 << 16),
|
||||
|
||||
PR_ORIGINAL_SENDER_ADDRTYPE = PT.PT_TSTRING | (0x0066 << 16),
|
||||
PR_ORIGINAL_SENDER_ADDRTYPE_W = PT.PT_UNICODE | (0x0066 << 16),
|
||||
PR_ORIGINAL_SENDER_ADDRTYPE_A = PT.PT_STRING8 | (0x0066 << 16),
|
||||
PR_ORIGINAL_SENDER_EMAIL_ADDRESS = PT.PT_TSTRING | (0x0067 << 16),
|
||||
PR_ORIGINAL_SENDER_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x0067 << 16),
|
||||
PR_ORIGINAL_SENDER_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x0067 << 16),
|
||||
|
||||
PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE = PT.PT_TSTRING | (0x0068 << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE_W = PT.PT_UNICODE | (0x0068 << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE_A = PT.PT_STRING8 | (0x0068 << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS = PT.PT_TSTRING | (0x0069 << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x0069 << 16),
|
||||
PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x0069 << 16),
|
||||
|
||||
PR_CONVERSATION_TOPIC = PT.PT_TSTRING | (0x0070 << 16),
|
||||
PR_CONVERSATION_TOPIC_W = PT.PT_UNICODE | (0x0070 << 16),
|
||||
PR_CONVERSATION_TOPIC_A = PT.PT_STRING8 | (0x0070 << 16),
|
||||
PR_CONVERSATION_INDEX = PT.PT_BINARY | (0x0071 << 16),
|
||||
|
||||
PR_ORIGINAL_DISPLAY_BCC = PT.PT_TSTRING | (0x0072 << 16),
|
||||
PR_ORIGINAL_DISPLAY_BCC_W = PT.PT_UNICODE | (0x0072 << 16),
|
||||
PR_ORIGINAL_DISPLAY_BCC_A = PT.PT_STRING8 | (0x0072 << 16),
|
||||
PR_ORIGINAL_DISPLAY_CC = PT.PT_TSTRING | (0x0073 << 16),
|
||||
PR_ORIGINAL_DISPLAY_CC_W = PT.PT_UNICODE | (0x0073 << 16),
|
||||
PR_ORIGINAL_DISPLAY_CC_A = PT.PT_STRING8 | (0x0073 << 16),
|
||||
PR_ORIGINAL_DISPLAY_TO = PT.PT_TSTRING | (0x0074 << 16),
|
||||
PR_ORIGINAL_DISPLAY_TO_W = PT.PT_UNICODE | (0x0074 << 16),
|
||||
PR_ORIGINAL_DISPLAY_TO_A = PT.PT_STRING8 | (0x0074 << 16),
|
||||
|
||||
PR_RECEIVED_BY_ADDRTYPE = PT.PT_TSTRING | (0x0075 << 16),
|
||||
PR_RECEIVED_BY_ADDRTYPE_W = PT.PT_UNICODE | (0x0075 << 16),
|
||||
PR_RECEIVED_BY_ADDRTYPE_A = PT.PT_STRING8 | (0x0075 << 16),
|
||||
PR_RECEIVED_BY_EMAIL_ADDRESS = PT.PT_TSTRING | (0x0076 << 16),
|
||||
PR_RECEIVED_BY_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x0076 << 16),
|
||||
PR_RECEIVED_BY_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x0076 << 16),
|
||||
|
||||
PR_RCVD_REPRESENTING_ADDRTYPE = PT.PT_TSTRING | (0x0077 << 16),
|
||||
PR_RCVD_REPRESENTING_ADDRTYPE_W = PT.PT_UNICODE | (0x0077 << 16),
|
||||
PR_RCVD_REPRESENTING_ADDRTYPE_A = PT.PT_STRING8 | (0x0077 << 16),
|
||||
PR_RCVD_REPRESENTING_EMAIL_ADDRESS = PT.PT_TSTRING | (0x0078 << 16),
|
||||
PR_RCVD_REPRESENTING_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x0078 << 16),
|
||||
PR_RCVD_REPRESENTING_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x0078 << 16),
|
||||
|
||||
PR_ORIGINAL_AUTHOR_ADDRTYPE = PT.PT_TSTRING | (0x0079 << 16),
|
||||
PR_ORIGINAL_AUTHOR_ADDRTYPE_W = PT.PT_UNICODE | (0x0079 << 16),
|
||||
PR_ORIGINAL_AUTHOR_ADDRTYPE_A = PT.PT_STRING8 | (0x0079 << 16),
|
||||
PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS = PT.PT_TSTRING | (0x007A << 16),
|
||||
PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x007A << 16),
|
||||
PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x007A << 16),
|
||||
|
||||
PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE = PT.PT_TSTRING | (0x007B << 16),
|
||||
PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE_W = PT.PT_UNICODE | (0x007B << 16),
|
||||
PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE_A = PT.PT_STRING8 | (0x007B << 16),
|
||||
PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS = PT.PT_TSTRING | (0x007C << 16),
|
||||
PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS_W = PT.PT_UNICODE | (0x007C << 16),
|
||||
PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS_A = PT.PT_STRING8 | (0x007C << 16),
|
||||
|
||||
PR_TRANSPORT_MESSAGE_HEADERS = PT.PT_TSTRING | (0x007D << 16),
|
||||
PR_TRANSPORT_MESSAGE_HEADERS_W = PT.PT_UNICODE | (0x007D << 16),
|
||||
PR_TRANSPORT_MESSAGE_HEADERS_A = PT.PT_STRING8 | (0x007D << 16),
|
||||
|
||||
PR_DELEGATION = PT.PT_BINARY | (0x007E << 16),
|
||||
|
||||
PR_TNEF_CORRELATION_KEY = PT.PT_BINARY | (0x007F << 16),
|
||||
|
||||
// Message content properties
|
||||
PR_BODY = PT.PT_TSTRING | (0x1000 << 16),
|
||||
PR_BODY_W = PT.PT_UNICODE | (0x1000 << 16),
|
||||
PR_BODY_A = PT.PT_STRING8 | (0x1000 << 16),
|
||||
PR_REPORT_TEXT = PT.PT_TSTRING | (0x1001 << 16),
|
||||
PR_REPORT_TEXT_W = PT.PT_UNICODE | (0x1001 << 16),
|
||||
PR_REPORT_TEXT_A = PT.PT_STRING8 | (0x1001 << 16),
|
||||
PR_ORIGINATOR_AND_DL_EXPANSION_HISTORY = PT.PT_BINARY | (0x1002 << 16),
|
||||
PR_REPORTING_DL_NAME = PT.PT_BINARY | (0x1003 << 16),
|
||||
PR_REPORTING_MTA_CERTIFICATE = PT.PT_BINARY | (0x1004 << 16)
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Interoperability", "CA1401:PInvokesShouldNotBeVisible")]
|
||||
[SuppressMessage("Microsoft.Design", "CA1060:MovePInvokesToNativeMethodsClass")]
|
||||
public class OutlookUtils
|
||||
{
|
||||
private const uint KEEP_OPEN_READONLY = 0x00000001;
|
||||
private const uint KEEP_OPEN_READWRITE = 0x00000002;
|
||||
private const uint FORCE_SAVE = 0x00000004;
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
|
||||
/// <summary>
|
||||
/// Tries to save the changes we just made
|
||||
/// </summary>
|
||||
/// <param name="mailItem"></param>
|
||||
/// <returns></returns>
|
||||
public static bool SaveChanges(IMailItem mailItem)
|
||||
{
|
||||
// Pointer to IUnknown Interface
|
||||
var IUnknown = IntPtr.Zero;
|
||||
// Pointer to IMAPIProp Interface
|
||||
var IMAPIProp = IntPtr.Zero;
|
||||
// if we have no MAPIObject everything is senseless...
|
||||
if (mailItem == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// We can pass NULL here as parameter, so we do it.
|
||||
MAPIInitialize(IntPtr.Zero);
|
||||
// retrive the IUnknon Interface from our MAPIObject comming from Outlook.
|
||||
IUnknown = Marshal.GetIUnknownForObject(mailItem.MAPIOBJECT);
|
||||
|
||||
// create a Guid that we pass to retreive the IMAPIProp Interface.
|
||||
var guidIMAPIProp = new Guid(IID_IMAPIProp);
|
||||
|
||||
// try to retrieve the IMAPIProp interface from IMessage Interface, everything else is sensless.
|
||||
if (Marshal.QueryInterface(IUnknown, ref guidIMAPIProp, out IMAPIProp) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var mapiProp = (IMAPIProp) Marshal.GetTypedObjectForIUnknown(IUnknown, typeof(IMAPIProp));
|
||||
return mapiProp.SaveChanges(KEEP_OPEN_READWRITE) == 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error().WriteLine(ex);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// cleanup all references to COM Objects
|
||||
if (IMAPIProp != IntPtr.Zero)
|
||||
{
|
||||
Marshal.Release(IMAPIProp);
|
||||
}
|
||||
//if (IMessage != IntPtr.Zero) Marshal.Release(IMessage);
|
||||
if (IUnknown != IntPtr.Zero)
|
||||
{
|
||||
Marshal.Release(IUnknown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Uses the IMAPIPROP.SetProps to set the content ID
|
||||
/// </summary>
|
||||
/// <param name="attachment"></param>
|
||||
/// <param name="contentId"></param>
|
||||
public static void SetContentID(IAttachment attachment, string contentId)
|
||||
{
|
||||
// Pointer to IUnknown Interface
|
||||
var IUnknown = IntPtr.Zero;
|
||||
// Pointer to IMAPIProp Interface
|
||||
var IMAPIProp = IntPtr.Zero;
|
||||
// A pointer that points to the SPropValue structure
|
||||
var ptrPropValue = IntPtr.Zero;
|
||||
// Structure that will hold the Property Value
|
||||
SPropValue propValue;
|
||||
// if we have no MAPIObject everything is senseless...
|
||||
if (attachment == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// We can pass NULL here as parameter, so we do it.
|
||||
MAPIInitialize(IntPtr.Zero);
|
||||
|
||||
// retrive the IUnknon Interface from our MAPIObject comming from Outlook.
|
||||
IUnknown = Marshal.GetIUnknownForObject(attachment.MAPIOBJECT);
|
||||
var mapiProp = (IMAPIProp) Marshal.GetTypedObjectForIUnknown(IUnknown, typeof(IMAPIProp));
|
||||
|
||||
// Create structure
|
||||
propValue = new SPropValue
|
||||
{
|
||||
propTag = (uint) PropTags.PR_ATTACH_CONTENT_ID,
|
||||
Value = Marshal.StringToHGlobalUni(contentId)
|
||||
};
|
||||
//propValue.propTag = 0x3712001E;
|
||||
// Create Ansi string
|
||||
|
||||
// Create unmanaged memory for structure
|
||||
ptrPropValue = Marshal.AllocHGlobal(Marshal.SizeOf(propValue));
|
||||
// Copy structure to unmanged memory
|
||||
Marshal.StructureToPtr(propValue, ptrPropValue, false);
|
||||
mapiProp.SetProps(1, ptrPropValue, IntPtr.Zero);
|
||||
|
||||
propValue.propTag = (uint) PropTags.PR_ATTACH_CONTENT_LOCATION;
|
||||
// Copy structure to unmanged memory
|
||||
Marshal.StructureToPtr(propValue, ptrPropValue, false);
|
||||
mapiProp.SetProps(1, ptrPropValue, IntPtr.Zero);
|
||||
|
||||
|
||||
// Free string
|
||||
Marshal.FreeHGlobal(propValue.Value);
|
||||
mapiProp.SaveChanges(KEEP_OPEN_READWRITE);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error().WriteLine(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Free used Memory structures
|
||||
if (ptrPropValue != IntPtr.Zero)
|
||||
{
|
||||
Marshal.FreeHGlobal(ptrPropValue);
|
||||
}
|
||||
// cleanup all references to COM Objects
|
||||
if (IMAPIProp != IntPtr.Zero)
|
||||
{
|
||||
Marshal.Release(IMAPIProp);
|
||||
}
|
||||
//if (IMessage != IntPtr.Zero) Marshal.Release(IMessage);
|
||||
if (IUnknown != IntPtr.Zero)
|
||||
{
|
||||
Marshal.Release(IUnknown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use MAPI32.DLL "HrSetOneProp" from managed code
|
||||
/// </summary>
|
||||
/// <param name="attachment"></param>
|
||||
/// <param name="proptag"></param>
|
||||
/// <param name="propertyValue"></param>
|
||||
/// <returns></returns>
|
||||
public static bool SetMAPIProperty(IAttachment attachment, PropTags proptag, string propertyValue)
|
||||
{
|
||||
// Pointer to IUnknown Interface
|
||||
var IUnknown = IntPtr.Zero;
|
||||
// Pointer to IMAPIProp Interface
|
||||
var IMAPIProp = IntPtr.Zero;
|
||||
// Structure that will hold the Property Value
|
||||
SPropValue propValue;
|
||||
// A pointer that points to the SPropValue structure
|
||||
var ptrPropValue = IntPtr.Zero;
|
||||
var mapiObject = attachment.MAPIOBJECT;
|
||||
// if we have no MAPIObject everything is senseless...
|
||||
if (mapiObject == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// We can pass NULL here as parameter, so we do it.
|
||||
MAPIInitialize(IntPtr.Zero);
|
||||
|
||||
// retrive the IUnknon Interface from our MAPIObject comming from Outlook.
|
||||
IUnknown = Marshal.GetIUnknownForObject(mapiObject);
|
||||
|
||||
// create a Guid that we pass to retreive the IMAPIProp Interface.
|
||||
var guidIMAPIProp = new Guid(IID_IMAPIProp);
|
||||
|
||||
// try to retrieve the IMAPIProp interface from IMessage Interface, everything else is sensless.
|
||||
if (Marshal.QueryInterface(IUnknown, ref guidIMAPIProp, out IMAPIProp) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// double check, if we wave no pointer, exit...
|
||||
if (IMAPIProp == IntPtr.Zero)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create structure
|
||||
propValue = new SPropValue
|
||||
{
|
||||
propTag = (uint) proptag,
|
||||
Value = Marshal.StringToHGlobalUni(propertyValue)
|
||||
};
|
||||
// Create Ansi string
|
||||
|
||||
// Create unmanaged memory for structure
|
||||
ptrPropValue = Marshal.AllocHGlobal(Marshal.SizeOf(propValue));
|
||||
// Copy structure to unmanged memory
|
||||
Marshal.StructureToPtr(propValue, ptrPropValue, false);
|
||||
|
||||
// Set the property
|
||||
HrSetOneProp(IMAPIProp, ptrPropValue);
|
||||
|
||||
// Free string
|
||||
Marshal.FreeHGlobal(propValue.Value);
|
||||
var mapiProp = (IMAPIProp) Marshal.GetTypedObjectForIUnknown(IUnknown, typeof(IMAPIProp));
|
||||
return mapiProp.SaveChanges(4) == 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error().WriteLine(ex);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Free used Memory structures
|
||||
if (ptrPropValue != IntPtr.Zero)
|
||||
{
|
||||
Marshal.FreeHGlobal(ptrPropValue);
|
||||
}
|
||||
// cleanup all references to COM Objects
|
||||
if (IMAPIProp != IntPtr.Zero)
|
||||
{
|
||||
Marshal.Release(IMAPIProp);
|
||||
}
|
||||
//if (IMessage != IntPtr.Zero) Marshal.Release(IMessage);
|
||||
if (IUnknown != IntPtr.Zero)
|
||||
{
|
||||
Marshal.Release(IUnknown);
|
||||
}
|
||||
MAPIUninitialize();
|
||||
}
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
[ComImport]
|
||||
[Guid(IID_IMAPIProp)]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
private interface IMessage : IMAPIProp
|
||||
{
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int GetAttachmentTable();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int OpenAttach();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int CreateAttach();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int DeleteAttach();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int GetRecipientTable();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int ModifyRecipients();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int SubmitMessage();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int SetReadFlag();
|
||||
}
|
||||
|
||||
// [ComVisible(false)]
|
||||
// [ComImport()]
|
||||
// [Guid(IID_IMAPIFolder)]
|
||||
// [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
// interface IMAPIFolder : IMAPIContainer {
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int CreateMessage(IntPtr interf, uint uFlags, [MarshalAs(UnmanagedType.Interface)] ref IMessage pMsg);
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int CopyMessages();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int CreateFolder();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int CopyFolder();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int DeleteFolder();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int SetReadFlags();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int GetMessageStatus();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int SetMessageStatus();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int SaveContentsSort();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int EmptyFolder();
|
||||
// }
|
||||
// [ComVisible(false)]
|
||||
// [ComImport()]
|
||||
// [Guid(IID_IMAPIContainer)]
|
||||
// [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
// interface IMAPIContainer : IMAPIProp {
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int GetContentsTable(uint uFlags, [MarshalAs(UnmanagedType.Interface), Out] out outlook.Table tbl);
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int GetHierarchyTable();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int OpenEntry();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int SetSearchCriteria();
|
||||
// [return: MarshalAs(UnmanagedType.I4)]
|
||||
// [PreserveSig]
|
||||
// int GetSearchCriteria();
|
||||
// }
|
||||
|
||||
[ComVisible(false)]
|
||||
[ComImport]
|
||||
[Guid(IID_IMAPIProp)]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
private interface IMAPIProp
|
||||
{
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int GetLastError();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int SaveChanges(
|
||||
uint uFlags
|
||||
);
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int GetProps();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int GetPropList();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int OpenProperty();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int SetProps(uint values, IntPtr propArray, IntPtr problems);
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int DeleteProps();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int CopyTo();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int CopyProps();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int GetNamesFromIDs();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.I4)]
|
||||
[PreserveSig]
|
||||
int GetIDsFromNames();
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
private struct SPropValue
|
||||
{
|
||||
[FieldOffset(0)] public uint propTag;
|
||||
[FieldOffset(4)] public readonly uint alignPad;
|
||||
[FieldOffset(8)] public IntPtr Value;
|
||||
[FieldOffset(8)] public readonly long filler;
|
||||
}
|
||||
|
||||
#region MAPI Interface ID'S
|
||||
|
||||
// The Interface ID's are used to retrieve the specific MAPI Interfaces from the IUnknown Object
|
||||
public const string IID_IMAPISession = "00020300-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPIProp = "00020303-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPITable = "00020301-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPIMsgStore = "00020306-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPIFolder = "0002030C-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPISpoolerService = "0002031E-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPIStatus = "0002031E-0000-0000-C000-000000000046";
|
||||
public const string IID_IMessage = "00020307-0000-0000-C000-000000000046";
|
||||
public const string IID_IAddrBook = "00020309-0000-0000-C000-000000000046";
|
||||
public const string IID_IProfSect = "00020304-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPIContainer = "0002030B-0000-0000-C000-000000000046";
|
||||
public const string IID_IABContainer = "0002030D-0000-0000-C000-000000000046";
|
||||
public const string IID_IMsgServiceAdmin = "0002031D-0000-0000-C000-000000000046";
|
||||
public const string IID_IProfAdmin = "0002031C-0000-0000-C000-000000000046";
|
||||
public const string IID_IMailUser = "0002030A-0000-0000-C000-000000000046";
|
||||
public const string IID_IDistList = "0002030E-0000-0000-C000-000000000046";
|
||||
public const string IID_IAttachment = "00020308-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPIControl = "0002031B-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPILogonRemote = "00020346-0000-0000-C000-000000000046";
|
||||
public const string IID_IMAPIForm = "00020327-0000-0000-C000-000000000046";
|
||||
|
||||
#endregion
|
||||
|
||||
#region MAPI DLL Imports
|
||||
|
||||
[DllImport("MAPI32.DLL", EntryPoint = "HrSetOneProp@8")]
|
||||
private static extern void HrSetOneProp(IntPtr pmp, IntPtr pprop);
|
||||
|
||||
[DllImport("MAPI32.DLL")]
|
||||
private static extern int MAPIInitialize(IntPtr lpMapiInit);
|
||||
|
||||
[DllImport("MAPI32.DLL")]
|
||||
private static extern void MAPIUninitialize();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum PageInfo
|
||||
{
|
||||
piBasic = 0, // Returns only basic page content, without selection markup and binary data objects. This is the standard value to pass.
|
||||
piBinaryData = 1, // Returns page content with no selection markup, but with all binary data.
|
||||
piSelection = 2, // Returns page content with selection markup, but no binary data.
|
||||
piBinaryDataSelection = 3, // Returns page content with selection markup and all binary data.
|
||||
piAll = 3 // Returns all page content.
|
||||
}
|
||||
}
|
@ -1,172 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
using System.Collections;
|
||||
using Dapplo.Windows.Com;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
// See http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.application_members.aspx
|
||||
[ComProgId("Powerpoint.Application")]
|
||||
public interface IPowerpointApplication : IComCommon
|
||||
{
|
||||
IPresentation ActivePresentation { get; }
|
||||
IPresentations Presentations { get; }
|
||||
bool Visible { get; set; }
|
||||
IPowerpointWindow ActiveWindow { get; }
|
||||
string Version { get; }
|
||||
void Activate();
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.slides_members.aspx
|
||||
public interface ISlides : IComCommon
|
||||
{
|
||||
int Count { get; }
|
||||
ISlide Add(int Index, int layout);
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.documentwindow.view.aspx
|
||||
public interface IPowerpointWindow : IComCommon
|
||||
{
|
||||
IPowerpointView View { get; }
|
||||
void Activate();
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.view_members.aspx
|
||||
public interface IPowerpointView : IComCommon
|
||||
{
|
||||
IZoom Zoom { get; }
|
||||
void GotoSlide(int index);
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.presentation_members.aspx
|
||||
public interface IPresentation : IComCommon
|
||||
{
|
||||
string Name { get; }
|
||||
ISlides Slides { get; }
|
||||
IPowerpointApplication Application { get; }
|
||||
MsoTriState ReadOnly { get; }
|
||||
bool Final { get; set; }
|
||||
IPageSetup PageSetup { get; }
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.presentations_members.aspx
|
||||
public interface IPresentations : IComCommon, IComCollection
|
||||
{
|
||||
IPresentation Add(MsoTriState WithWindow);
|
||||
IPresentation item(int index);
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.pagesetup_members.aspx
|
||||
public interface IPageSetup : IComCommon, IComCollection
|
||||
{
|
||||
float SlideWidth { get; set; }
|
||||
float SlideHeight { get; set; }
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.slide_members.aspx
|
||||
public interface ISlide : IComCommon
|
||||
{
|
||||
IShapes Shapes { get; }
|
||||
int SlideNumber { get; }
|
||||
void Select();
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shapes_members.aspx
|
||||
public interface IShapes : IComCommon, IEnumerable
|
||||
{
|
||||
int Count { get; }
|
||||
IShape item(int index);
|
||||
IShape AddPicture(string FileName, MsoTriState LinkToFile, MsoTriState SaveWithDocument, float Left, float Top, float Width, float Height);
|
||||
}
|
||||
|
||||
// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shape_members.aspx
|
||||
public interface IShape : IComCommon
|
||||
{
|
||||
float Left { get; set; }
|
||||
float Top { get; set; }
|
||||
float Width { get; set; }
|
||||
float Height { get; set; }
|
||||
ITextFrame TextFrame { get; }
|
||||
string AlternativeText { get; set; }
|
||||
MsoTriState LockAspectRatio { get; set; }
|
||||
void ScaleWidth(float Factor, MsoTriState RelativeToOriginalSize, MsoScaleFrom fScale);
|
||||
void ScaleHeight(float Factor, MsoTriState RelativeToOriginalSize, MsoScaleFrom fScale);
|
||||
}
|
||||
|
||||
public interface ITextFrame : IComCommon
|
||||
{
|
||||
ITextRange TextRange { get; }
|
||||
MsoTriState HasText { get; }
|
||||
}
|
||||
|
||||
public interface ITextRange : IComCommon
|
||||
{
|
||||
string Text { get; set; }
|
||||
}
|
||||
|
||||
public enum PPSlideLayout
|
||||
{
|
||||
ppLayoutMixed = -2,
|
||||
ppLayoutTitle = 1,
|
||||
ppLayoutText = 2,
|
||||
ppLayoutTwoColumnText = 3,
|
||||
ppLayoutTable = 4,
|
||||
ppLayoutTextAndChart = 5,
|
||||
ppLayoutChartAndText = 6,
|
||||
ppLayoutOrgchart = 7,
|
||||
ppLayoutChart = 8,
|
||||
ppLayoutTextAndClipart = 9,
|
||||
ppLayoutClipartAndText = 10,
|
||||
ppLayoutTitleOnly = 11,
|
||||
ppLayoutBlank = 12,
|
||||
ppLayoutTextAndObject = 13,
|
||||
ppLayoutObjectAndText = 14,
|
||||
ppLayoutLargeObject = 15,
|
||||
ppLayoutObject = 16,
|
||||
ppLayoutTextAndMediaClip = 17,
|
||||
ppLayoutMediaClipAndText = 18,
|
||||
ppLayoutObjectOverText = 19,
|
||||
ppLayoutTextOverObject = 20,
|
||||
ppLayoutTextAndTwoObjects = 21,
|
||||
ppLayoutTwoObjectsAndText = 22,
|
||||
ppLayoutTwoObjectsOverText = 23,
|
||||
ppLayoutFourObjects = 24,
|
||||
ppLayoutVerticalText = 25,
|
||||
ppLayoutClipArtAndVerticalText = 26,
|
||||
ppLayoutVerticalTitleAndText = 27,
|
||||
ppLayoutVerticalTitleAndTextOverChart = 28,
|
||||
ppLayoutTwoObjects = 29,
|
||||
ppLayoutObjectAndTwoObjects = 30,
|
||||
ppLayoutTwoObjectsAndObject = 31,
|
||||
ppLayoutCustom = 32,
|
||||
ppLayoutSectionHeader = 33,
|
||||
ppLayoutComparison = 34,
|
||||
ppLayoutContentWithCaption = 35,
|
||||
ppLayoutPictureWithCaption = 36
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usings
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// Schema definitions for the MAPI properties
|
||||
/// See: http://msdn.microsoft.com/en-us/library/aa454438.aspx
|
||||
/// and see: http://msdn.microsoft.com/en-us/library/bb446117.aspx
|
||||
/// </summary>
|
||||
public static class PropTag
|
||||
{
|
||||
public const string ATTACHMENT_CONTENT_ID = @"http://schemas.microsoft.com/mapi/proptag/0x3712001E";
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum SpecialLocation
|
||||
{
|
||||
slBackupFolder = 0,
|
||||
slUnfiledNotesSection = 1,
|
||||
slDefaultNotebookFolder = 2
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
/// <summary>
|
||||
/// Units: http://msdn.microsoft.com/en-us/library/office/bb214015(v=office.12).aspx
|
||||
/// </summary>
|
||||
public enum WdUnits
|
||||
{
|
||||
wdCell = 12,
|
||||
wdCharacter = 1,
|
||||
wdCharacterFormatting = 13,
|
||||
wdColumn = 9,
|
||||
wdItem = 16,
|
||||
wdLine = 5,
|
||||
wdParagraph = 4,
|
||||
wdParagraphFormatting = 14,
|
||||
wdRow = 10,
|
||||
wdScreen = 7,
|
||||
wdSection = 8,
|
||||
wdSentence = 3,
|
||||
wdStory = 6,
|
||||
wdTable = 15,
|
||||
wdWindow = 11,
|
||||
wdWord = 2
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
#region Greenshot GNU General Public License
|
||||
|
||||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Greenshot.Addon.Office.OfficeInterop
|
||||
{
|
||||
public enum XMLSchema
|
||||
{
|
||||
xs2007 = 0,
|
||||
xs2010 = 1,
|
||||
xsCurrent = xs2010
|
||||
}
|
||||
}
|
@ -25,10 +25,10 @@ using System.Collections.Generic;
|
||||
using System.Reactive.Disposables;
|
||||
using Dapplo.CaliburnMicro.Configuration;
|
||||
using Dapplo.CaliburnMicro.Extensions;
|
||||
using Greenshot.Addon.Office.OfficeInterop;
|
||||
using Greenshot.Addons;
|
||||
using Greenshot.Addons.Core.Enums;
|
||||
using Greenshot.Addons.Extensions;
|
||||
using Microsoft.Office.Interop.PowerPoint;
|
||||
|
||||
namespace Greenshot.Addon.Office.ViewModels
|
||||
{
|
||||
@ -80,7 +80,7 @@ namespace Greenshot.Addon.Office.ViewModels
|
||||
base.OnDeactivate(close);
|
||||
}
|
||||
|
||||
public PPSlideLayout SelectedSlideLayout
|
||||
public PpSlideLayout SelectedSlideLayout
|
||||
{
|
||||
get => OfficeConfiguration.PowerpointSlideLayout;
|
||||
set
|
||||
@ -90,6 +90,6 @@ namespace Greenshot.Addon.Office.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public IDictionary<PPSlideLayout, string> SlideLayouts => GreenshotLanguage.TranslationValuesForEnum<PPSlideLayout>();
|
||||
public IDictionary<PpSlideLayout, string> SlideLayouts => GreenshotLanguage.TranslationValuesForEnum<PpSlideLayout>();
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,10 @@
|
||||
<package id="Dapplo.Windows.Messages" version="0.5.108" targetFramework="net461" />
|
||||
<package id="Dapplo.Windows.User32" version="0.5.108" targetFramework="net461" />
|
||||
<package id="Fody" version="3.1.4" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1000" targetFramework="net461" />
|
||||
<package id="Microsoft.Office.Interop.Outlook" version="15.0.4797.1003" targetFramework="net461" />
|
||||
<package id="Microsoft.Office.Interop.PowerPoint" version="15.0.4420.1017" targetFramework="net461" />
|
||||
<package id="Microsoft.Office.Interop.Word" version="15.0.4797.1003" targetFramework="net461" />
|
||||
<package id="System.Reactive" version="4.1.0" targetFramework="net461" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.1" targetFramework="net461" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.1" targetFramework="net461" />
|
||||
|
@ -175,7 +175,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -163,7 +163,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -166,7 +166,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -144,7 +144,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
@ -181,6 +180,10 @@
|
||||
<Reference Include="Windows">
|
||||
<HintPath>C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0\Windows.winmd</HintPath>
|
||||
</Reference>
|
||||
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
|
||||
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
|
||||
<Name>Greenshot.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
|
||||
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
|
||||
<Name>Greenshot.Gfx</Name>
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@ -35,10 +36,11 @@ using Greenshot.Addon.Win10.Native;
|
||||
using Greenshot.Addons;
|
||||
using Greenshot.Addons.Components;
|
||||
using Greenshot.Addons.Core;
|
||||
using Greenshot.Addons.Core.Enums;
|
||||
using Greenshot.Addons.Interfaces;
|
||||
using Greenshot.Addons.Interfaces.Plugin;
|
||||
using Greenshot.Core.Enums;
|
||||
using Greenshot.Gfx;
|
||||
using Color = Windows.UI.Color;
|
||||
|
||||
namespace Greenshot.Addon.Win10
|
||||
{
|
||||
|
@ -12,11 +12,14 @@ namespace Greenshot.Addons.Components
|
||||
private readonly IEnumerable<Lazy<IDestination, DestinationAttribute>> _destinations;
|
||||
private readonly IEnumerable<IDestinationProvider> _destinationProviders;
|
||||
|
||||
public static DestinationHolder Instance { get; internal set; }
|
||||
|
||||
public DestinationHolder(
|
||||
IEnumerable<Lazy<IDestination, DestinationAttribute>> destinations,
|
||||
IEnumerable<IDestinationProvider> destinationProviders
|
||||
)
|
||||
{
|
||||
Instance = this;
|
||||
_destinations = destinations;
|
||||
_destinationProviders = destinationProviders;
|
||||
}
|
||||
|
@ -66,6 +66,20 @@ namespace Greenshot.Addons.Components
|
||||
Log.Info().WriteLine("No notification due to ShowTrayNotification = {0} - or export made = {1}", _coreConfiguration.ShowTrayNotification);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!exportInformation.ExportMade)
|
||||
{
|
||||
if (exportInformation.IsError)
|
||||
{
|
||||
Log.Warn().WriteLine("{0}", exportInformation.ErrorMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Debug().WriteLine("Export to {0} cancelled.", exportInformation.DestinationDesignation);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// Create the ViewModel "part"
|
||||
var message = _toastFactory(source, exportInformation, exportedSurface, configScreen);
|
||||
// Prepare to dispose the view model parts automatically if it's finished
|
||||
@ -80,6 +94,5 @@ namespace Greenshot.Addons.Components
|
||||
// Show the ViewModel as toast
|
||||
_eventAggregator.PublishOnCurrentThread(message.Value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ namespace Greenshot.Addons.Core
|
||||
/// <returns>Task</returns>
|
||||
protected virtual Task PrepareDynamicDestinations(ToolStripMenuItem destinationToolStripMenuItem)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -112,7 +112,7 @@ namespace Greenshot.Addons.Core
|
||||
/// <returns>Task</returns>
|
||||
protected virtual Task AfterDynamicDestinations(ToolStripMenuItem destinationToolStripMenuItem)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@ -146,7 +146,8 @@ namespace Greenshot.Addons.Core
|
||||
/// <returns></returns>
|
||||
public virtual Task<ExportInformation> ExportCaptureAsync(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails)
|
||||
{
|
||||
return Task.FromResult(ExportCapture(manuallyInitiated, surface, captureDetails));
|
||||
var syncResult = ExportCapture(manuallyInitiated, surface, captureDetails);
|
||||
return Task.FromResult(syncResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -415,7 +416,7 @@ namespace Greenshot.Addons.Core
|
||||
/// This method will show the supplied context menu at the mouse cursor, also makes sure it has focus and it's not
|
||||
/// visible in the taskbar.
|
||||
/// </summary>
|
||||
/// <param name="menu"></param>
|
||||
/// <param name="menu">ContextMenuStrip</param>
|
||||
private static void ShowMenuAtCursor(ContextMenuStrip menu)
|
||||
{
|
||||
// find a suitable location
|
||||
|
@ -170,7 +170,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -65,7 +65,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -115,7 +115,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
@ -22,11 +22,8 @@
|
||||
<Reference Include="Autofac.Integration.Mef, Version=4.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Autofac.Mef.4.0.0\lib\net45\Autofac.Integration.Mef.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BenchmarkDotNet, Version=0.11.0.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\BenchmarkDotNet.0.11.0\lib\net46\BenchmarkDotNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BenchmarkDotNet.Toolchains.Roslyn, Version=0.10.14.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\BenchmarkDotNet.Toolchains.Roslyn.0.10.14\lib\net46\BenchmarkDotNet.Toolchains.Roslyn.dll</HintPath>
|
||||
<Reference Include="BenchmarkDotNet, Version=0.11.1.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\BenchmarkDotNet.0.11.1\lib\net46\BenchmarkDotNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Caliburn.Micro, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Caliburn.Micro.Core.3.2.0\lib\net45\Caliburn.Micro.dll</HintPath>
|
||||
|
@ -3,9 +3,7 @@
|
||||
<package id="Autofac" version="4.8.1" targetFramework="net461" />
|
||||
<package id="Autofac.Extras.AttributeMetadata" version="4.0.1" targetFramework="net461" />
|
||||
<package id="Autofac.Mef" version="4.0.0" targetFramework="net461" />
|
||||
<package id="BenchmarkDotNet" version="0.11.0" targetFramework="net461" />
|
||||
<package id="BenchmarkDotNet.Core" version="0.10.14" targetFramework="net461" />
|
||||
<package id="BenchmarkDotNet.Toolchains.Roslyn" version="0.10.14" targetFramework="net461" />
|
||||
<package id="BenchmarkDotNet" version="0.11.1" targetFramework="net461" />
|
||||
<package id="Caliburn.Micro" version="3.2.0" targetFramework="net461" />
|
||||
<package id="Caliburn.Micro.Core" version="3.2.0" targetFramework="net461" />
|
||||
<package id="CommandLineParser" version="2.3.0" targetFramework="net461" />
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user