Skip to content

Commit

Permalink
a few tweaks to encryption tool and custom task pane behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
huvanile committed Nov 12, 2016
1 parent 5d25a51 commit 26ea895
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 864 deletions.
18 changes: 11 additions & 7 deletions RCS_Clearing/Helpers/EmailHelpers.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ Imports Microsoft.Office.Interop.Outlook
Public Class EmailHelpers

Public Shared Sub SwapAndSteg(mail As Outlook.MailItem, steggedImage As String)
If Not String.IsNullOrEmpty(mail.HTMLBody) AndAlso mail.HTMLBody.ToLower().Contains("</body>") Then
mail.Attachments.Add(steggedImage, OlAttachmentType.olEmbeddeditem)
If mail.Subject = "" Then mail.Subject = "See attached pic"
mail.Body = "Hey, please check out the attached pic."
mail.Save()
End If
Try
If Not String.IsNullOrEmpty(mail.HTMLBody) AndAlso mail.HTMLBody.ToLower().Contains("</body>") Then
mail.Attachments.Add(steggedImage, OlAttachmentType.olEmbeddeditem)
If mail.Subject = "" Then mail.Subject = "See attached pic"
mail.Body = "Hey, please check out the attached pic."
mail.Save()
End If
Catch ex As system.Exception
Debug.Print(ex.message)
End Try
End Sub

Public Shared Property WIPEmailHTMLBody As String
Expand Down Expand Up @@ -41,7 +45,7 @@ Public Class EmailHelpers
Next
If tmp.Count = 0 Then tmp.Add("Selected email has no images attached")
Else
tmp.Add("Selected email has no images attached")
tmp.Add("Selected email has no images attached")
End If
Else
tmp.Add("Selected item is not an email")
Expand Down
4 changes: 2 additions & 2 deletions RCS_Clearing/Helpers/EncryptionHelpers.vb
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
Return answer
End Function

Function HexToString(ByVal hex As String) As String
Shared Function HexToString(ByVal hex As String) As String
Dim text As New StringBuilder(hex.Length \ 2)
For i As Integer = 0 To hex.Length - 2 Step 2
text.Append(Chr(Convert.ToByte(hex.Substring(i, 2), 16)))
Next
Return text.ToString
End Function

Function StringToHex(ByVal text As String) As String
Shared Function StringToHex(ByVal text As String) As String
Dim hex As New StringBuilder()
For i As Integer = 0 To text.Length - 1
hex.Append(Right(("0" & Asc(text.Substring(i, 1)).ToString("x").ToUpper), 2))
Expand Down
23 changes: 12 additions & 11 deletions RCS_Clearing/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports System
Imports System.Resources
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Security
Expand All @@ -9,20 +10,20 @@ Imports System.Security

' Review the values of the assembly attributes

<Assembly: AssemblyTitle("RCS_Clearing")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Grant Thornton LLP")>
<Assembly: AssemblyProduct("RCS_Clearing")>
<Assembly: AssemblyCopyright("Copyright © Grant Thornton LLP 2014")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyTitle("Quicktools for Outlook")>
<Assembly: AssemblyDescription("Tools for quickness in Outlook")>
<Assembly: AssemblyCompany("Grant Thornton LLP")>
<Assembly: AssemblyProduct("Quicktools for Outlook")>
<Assembly: AssemblyCopyright("GNU GPL")>
<Assembly: AssemblyTrademark("")>

' Setting ComVisible to false makes the types in this assembly not visible
' to COM components. If you need to access a type in this assembly from
' COM, set the ComVisible attribute to true on that type.
<Assembly: ComVisible(False)>

'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("b32b36e0-883c-4480-b316-8543840d3391")>
<Assembly: Guid("b32b36e0-883c-4480-b316-8543840d3391")>

' Version information for an assembly consists of the following four values:
'
Expand All @@ -35,9 +36,9 @@ Imports System.Security
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: NeutralResourcesLanguage("en")>
Friend Module DesignTimeConstants
Public Const RibbonTypeSerializer As String = "Microsoft.VisualStudio.Tools.Office.Ribbon.Serialization.RibbonTypeCodeDomSerializer, Microsoft.VisualStudio.Tools.Office.Designer, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Public Const RibbonBaseTypeSerializer As String = "System.ComponentModel.Design.Serialization.TypeCodeDomSerializer, System.Design"
Expand Down
12 changes: 9 additions & 3 deletions RCS_Clearing/QuickTools.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@
<EmbeddedResource Include="Taskpanes\tpnRCSStart.resx">
<DependentUpon>tpnRCSStart.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Taskpanes\tpnStegSteg.resx">
<DependentUpon>tpnStegSteg.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Taskpanes\tpnStegUnsteg.resx">
<DependentUpon>tpnStegUnsteg.vb</DependentUpon>
</EmbeddedResource>
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.vb</DependentUpon>
</None>
Expand Down Expand Up @@ -344,13 +350,13 @@
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>QuickTools_3_TemporaryKey.pfx</ManifestKeyFile>
<ManifestKeyFile>QuickTools_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>2C329EA4FD1C2B3F7BA037DBF9C9AC3A1E6DC3CA</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>DDCDB6DBDCB12523BF01C578137449300F2B894A</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<DelaySign>false</DelaySign>
Expand Down
34 changes: 21 additions & 13 deletions RCS_Clearing/Ribbons/RibbonNewMessage.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,29 @@ Public Class RibbonNewMessage
Public Shared taskpaneEncTools As tpnEncryptionTools : Public Shared ctpEncSteg As Microsoft.Office.Tools.CustomTaskPane

Private Sub btnStegEmail_Click(sender As Object, e As RibbonControlEventArgs) Handles btnStegEmail.Click
Dim dlLocation As String = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\OutlookQuickTools\"
taskpaneStegSteg = New tpnStegSteg
ctpStegSteg = Globals.ThisAddIn.CustomTaskPanes.Add(taskpaneStegSteg, "Hide Email in an Image")
ctpStegSteg.Width = 400
ctpStegSteg.Control.Width = 400
ctpStegSteg.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight
ctpStegSteg.Visible = True
Try
Dim dlLocation As String = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\OutlookQuickTools\"
taskpaneStegSteg = New tpnStegSteg
ctpStegSteg = Globals.ThisAddIn.CustomTaskPanes.Add(taskpaneStegSteg, "Hide Email in an Image")
ctpStegSteg.Width = 400
ctpStegSteg.Control.Width = 400
ctpStegSteg.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight
ctpStegSteg.Visible = True
Catch ex As Exception
MsgBox("An error occurred :(", vbCritical, ThisAddIn.Title)
End Try
End Sub

Private Sub btnEncryptEmail(sender As Object, e As RibbonControlEventArgs) Handles btnEncryptMessage.Click
taskpaneEncTools = New tpnEncryptionTools
ctpEncSteg = Globals.ThisAddIn.CustomTaskPanes.Add(taskpaneEncTools, "Email Encryption Tools")
ctpEncSteg.Width = 300
ctpEncSteg.Control.Width = 300
ctpEncSteg.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight
ctpEncSteg.Visible = True
Try
taskpaneEncTools = New tpnEncryptionTools
ctpEncSteg = Globals.ThisAddIn.CustomTaskPanes.Add(taskpaneEncTools, "Email Encryption Tools")
ctpEncSteg.Width = 300
ctpEncSteg.Control.Width = 300
ctpEncSteg.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight
ctpEncSteg.Visible = True
Catch ex As Exception
MsgBox("An error occurred :(", vbCritical, ThisAddIn.Title)
End Try
End Sub
End Class
74 changes: 33 additions & 41 deletions RCS_Clearing/Taskpanes/tpnEncryptionTools.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 26ea895

Please sign in to comment.