Sujet : Re: 40tude Ddialog - sent messages
De : b.rose.tmpbox (at) *nospam* arcor.de (Bernd Rose)
Groupes : news.software.readersDate : 08. May 2024, 18:56:29
Autres entêtes
Message-ID : <17kv2st662pe9.dlg@b.rose.tmpbox.news.arcor.de>
References : 1 2 3
User-Agent : 40tude_Dialog/2.0.15.41 (c5183864.151.314)
On Wed, 08 May 2024 17:34:33 +0000, Mickey wrote:
Michael Thompson wrote:
You just need to find the posted messages on the newsgroup to save them.
The posts in my Sent folder go back much further than my news servers
retention period. Need to archive posts going back to 2010. Suppose
I could hunt them down individually by Message-ID on howardknight, but
'twould be less time consuming to save them out of my Sent folder.
You can try the following script. It should work with Sent. Switch the
"Headers view" (cf. message view options) on prior to running the script,
if you want to export them as well. (And not only the plain message text.)
The script has few error trappings, but usually should work well enough.
It will abort, though, if you at some time sent 2 equal messages in a row.
Switching on "Headers view" should reduce this possibility.
The script always works for the current group. Adjust the export file
name and divider character to your needs in the "Const" section of the
script. And maybe assign it to a toolbar button or a hotkey. It can be
run safely from inside the Script Editor. (After saving and compiling
it, of course.)
HTH.
Bernd
-------------------------------------------------------------------------
Program ExportMessages;
Uses StdCtrls, Forms, Textfile;
Const
FileName = 'C:\Temp\Dialog_Export.txt';
DividerChar = '=';
Var
iCount: Integer;
bFirst: Boolean;
txtForm: TForm;
txtMemo: TMemo;
txtMemo2: TMemo;
Procedure WriteTxtFile;
Var
txtFile: TextFile;
Begin
AssignFile(txtFile, FileName);
If fileexists(FileName)
Then
Begin
Append(txtFile);
txtMemo.Lines.Insert(0, #13+#10+#13+#10+StringOfChar(DividerChar, 80)+#13+#10+#13+#10);
End
Else Rewrite(txtFile);
TextWrite(txtFile, txtMemo.text);
CloseFile(txtFile);
End;
Begin
txtForm := TForm.Create(nil);
txtMemo := TMemo.Create(txtForm);
txtMemo.Parent := txtForm;
txtMemo2 := TMemo.Create(txtForm);
txtMemo2.Parent := txtForm;
iCount := 0;
bFirst := True
txtMemo2.Lines.Add(StringOfChar('§', 20)+' DUMMY '+StringOfChar('§', 20));
LockDisplay;
Try
ADo('FirstMessage');
While txtMemo.Text <> txtMemo2.Text Do
Begin
txtMemo2.Text := txtMemo.Text
txtMemo.Clear;
If Not bFirst Then ADo('NextMessage');
bFirst := False
ADo('ArticlePane');
ADo('SelectAll');
Ado('Copy');
txtMemo.PasteFromClipboard;
WriteTxtFile;
iCount := iCount + 1;
End;
ADo('FirstMessage');
Finally
UnlockDisplay;
txtForm.Free
End;
Application.MessageBox(IntToStr(iCount) + ' messges exorted to ' + FileName, 'Export finished', 0);
End.