Outlook "save message as text" without line breaks - outlook

I receive emails where the body contains raw data (long csv lines) from an external application. I want to store this data in a text file. However, when I store it (File->Save As->txt) Outlook automatically inserts line breaks at the position specified in the Outlook Options "Automatically wrap text at character". This cannot be set to anything higher than 132, and the remove extra line breaks does nothing when saving data.
Is there any way I can fix this or do I have to use another mail client than Outlook?

Through the GUI it may not be possible but one solution to this problem
is to use something other than the MailItem.SaveAs command in vba (macro code). https://forums.slipstick.com/threads/84759-line-breaks-added-to-text-file/

Related

Remove spaces from a string of text in clipboard

This is maybe a weird request but hear me out:
I have a huge database at my shop containing product codes, like 87 445 G 6 which I need to check for availability on a supplier's website. The problem is, the supplier's website consists of a web form in which I have to enter the code without spaces, so imagine that I have to manually delete spaces every time I paste a code or write it manually without.
I can't edit the database from which I copy the codes.
I wonder if some sort of plugin, script, or trick can be used directly in browser on the supplier's web form, or some software to modify how the windows clipboard works, maybe some option to copy text without spaces. Using Windows XP.
The OP has probably moved on, but for anyone else looking here, my approach was to tackle this from the windows clipboard side.
For background: I keep a list of my credit card info in Keepass. Sometimes (poorly coded) shopping cart checkout forms don't like spaces in between card numbers. I like storing them with spaces since it's easier to read off that way.
There's various Windows clipboard utilites out there, but it took me a while to find one that could do some processing on the clipboard contents and pasting it out - Clipboard Help and Spell
The program has a way to "save" a bunch of text transformations, and even assign the action to a hotkey.
For reference, my "Find and Replace" action is to find "\s" (without quotes) and leave the Replace textbox empty. "\s" will match whitespace character.
Use the javascript console
You could use the javascript console for your browser to edit the textarea after you paste.
Using Google Chrome (or Firefox)
Paste your text in the text area.
Right click the text area and click Inspect Element
Look at the id for the element
Now switch to the console view
then run these lines (making sure to replace with 'the-id' with your id)
var my_text_area = document.getElementById('the-id'); // Put your id in here
my_text_area.value = my_text_area.value.replace(/ /g,"") // Deletes just spaces
It's even simpler if you have access to jQuery:
$('#the-id').val($('#the-id').val().replace(/ /g, ""))
The replace function is simply using regular expressions to convert spaces to nothing. If you want to replace all whitespace (including newlines) you would use .replace(/\s/g,"").
For firefox, the names are the same but the UI is a little bit different.
Use greasemonkey
You can either write a greasemonkey plugin or try to find one that fits your needs.

Print File(NotePad) Without the name of the file appearing in the printing document

Dim ProcessProperties As New ProcessStartInfo()
ProcessProperties.FileName = "notepad.exe"
ProcessProperties.Arguments = "/p c:/doc.txt" 'command line arguments ''
''ProcessProperties.WindowStyle = ProcessWindowStyle.Maximized
Dim myProcess As Process = Process.Start(ProcessProperties)
when printing using the code above i have "doc.txt" printed. I don't want the file name to appear when printing is over
It is not possible to pass an argument through command line to notepad to hide the header, the only parameter accepted for the /P argument is the file name. (See link)
The only way to hide the header from printing is by opening notepad and going to File->Page Setup, and changing the header command. (See link)
If it is really needed to print using a process, you can try searching for third party editing tools which support printing arguments.
Another way is to implement functionality for printing the text file, see this Stackoverflow article (Link)
You will have to configure the header and footer options of Notepad in order to prevent or override the file name appearing on the print page. This can be done by simulating user input to bring up the Page Setup dialog and clear the header and footer.
There are a number of ways to send user input (mouse and/or keyboard). For starters you could look at these two:
Windows Input Simulator
Application and Global Mouse and Keyboard Hooks .Net Libary in C#

Printing page breaks from an MFC RichEdit control

I've created a Rich Edit control (1.0) from MFC as below:
m_hRichEditWnd = ::CreateWindow(_T("RichEdit"), csWindowName, ES_MULTILINE|ES_READONLY, 0, 0, 200, 200, NULL, 0, 0, 0);
I've read text into that control from a file. The file is a multipage .txt document with ascii control characters for page breaks. When I print from the Rich Edit control, I do not get the page breaks. They are printed out as characters. Is there any way to get those page breaks?
I'm printing out from the control using methods similar to those described here http://msdn.microsoft.com/en-us/library/windows/desktop/bb787875(v=vs.85).aspx
So something I left out was that I wasn't actually printing out to a physical printer but to a .ps file. That .ps file was then getting converted by ghost script to a pdf which did not register the page breaks. I believe this is due to the fact that the edit control does not actually SHOW page breaks inside it - and the way the print command works is almost like a graphic blit to a print device. The page break isn't "on screen" so it doesn't make it to the .ps file. That's a theory.
The only solution I found was to parse the information going into the CRichEditControl for form feed characters. Load up all characters up to the form feed character, print that to the file, then use the EndPage() function to manually force the form feed. Continue on in that way until there are not more form feed characters. Then make sure you print out any remaining characters after the last form feed.

SMTP Text file Attachment problem

I am sending a mail with text attachment from my VB6 application.
I am using Content-Transfer-Encoding:7bit in header for text attachment.
Problem is that after downloading file from mail,new lines are not displayed properly in NOTEPAD.
But other applications such as notepad++,wordpad are properly displaying the new lines as they are in the original text file.
Where i am going wrong?
My first guess would be that you are ending your lines with just a new-line, instead of a carriage-return/new-line pair. The windows standard is that you need cr/nl at the end of each line, while Linux puts only nl. Notepad chokes on lines that end with just nl, but Wordpad figures it out.

How do I edit a text buffer (or selected text) with the Visual Studio 2010 SDK

I want to create a simple extension which modifies text buffers based on a command. No sample, documentation or template that I've found so far explains anything about working with text buffers. Anyone got a clue how to do this?
What I want to end up with is a format selection/document extension for text files, that wrap content around 72 characters per line.
I found this extension together with sample very helpful, and now I have something which works. Though it was very counter intuitive at first, I was trying to get the at the code window while this example instead uses a command filter to fiddle with the text view by extending the editor.
The ITextView interface provides access to the text in the editor, you can access the Buffer through that and make changes that way.
Link
http://github.com/noahric/alignassignments

Resources