C:>"C:\Programme\Microsoft Office\Office10\OUTLOOK.EXE" /a
"c:\vimtemp\trigger.sql"

How can I run this inside of vim to attach the current buffer?

Have you tried putting a "!" in front of it?

For example, at the bottom of the vim window:

:!"C:\Programme\Microsoft Office\Office10\OUTLOOK.EXE" /a >
"c:\vimtemp\trigger.sql"

I would have tried this command myself, but I don't have outlook on my
machine.  Hopefully it works.

Tom is correct that you should be able to just use that command. You can also tweak it to be

:!"c:\...\outlook.exe" /a %

which, by using "%" as the file-name, will automatically replace the "%" with current file being edited. That way, you can do something like

:nnoremap <f4> :!"c:\path\to\outlook.exe" /a %

which will allow you to attach the currently saved version of the file you're editing. It does have an annoying side-effect that it opens a shell-window that you usually have to close.

I've also had modest success with

        :echo system('path/to/outlook.exe /a' . expand('%'))

though it hangs until the subprocesss completes.

It still gives an internal Vim message, but that can be worked around with

:sil! echo system('outlook.exe /a "'.expand('%').'"')

(adjust paths and escaping accordingly...I used "notepad" instead of "outlook" as that's what I had available)

Just a few more ideas.

-tim



Reply via email to