Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 51 additions & 5 deletions NSF2SQL/Form1.Designer.cs

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

28 changes: 28 additions & 0 deletions NSF2SQL/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ private void bExportDocuments_Click(object sender, EventArgs ea)
MessageBox.Show("Select a database.");
return;
}
if (string.IsNullOrEmpty(txbAttachmentsFolder.Text))
{
MessageBox.Show("Select a folder for attachments.");
return;
}
int total = 0;
long startTicks = 0;
long lastTicks = 0;
Expand Down Expand Up @@ -361,6 +366,23 @@ private void bExportDocuments_Click(object sender, EventArgs ea)
startTicks = DateTime.Now.Ticks;
for (int i = 0; i < total; i++)
{
object[] items = (object[])doc.Items;

foreach (NotesItem nItem in items)
{
if (nItem.Name == "$FILE")
{
NotesItem file = doc.GetFirstItem("$File");

string fileName = ((object[])nItem.Values)[0].ToString();

NotesEmbeddedObject attachfile = doc.GetAttachment(fileName);

if (attachfile != null)
attachfile.ExtractFile($@"{txbAttachmentsFolder.Text}\{fileName}");
}
}

//check if cancelled
if (pDialog.IsCancelled)
{
Expand Down Expand Up @@ -830,5 +852,11 @@ private NotesSession initSession(string password)
nSession.Initialize(password);
return nSession;
}

private void btnBrowseAttachmentsFolder_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
txbAttachmentsFolder.Text = folderBrowserDialog1.SelectedPath;
}
}
}
5 changes: 4 additions & 1 deletion NSF2SQL/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAa
CQAAAk1TRnQBSQFMAgEBAgEAATABAAEwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CQAAAk1TRnQBSQFMAgEBAgEAATgBAAE4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
Expand Down Expand Up @@ -172,6 +172,9 @@
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>267, 17</value>
</metadata>
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>403, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down