Pages: 1
RSS
Sending documents from Microsoft Word with the Bat
 
Hello,

I can't find a way to configure The Bat for sending documents from Microsoft Word rightaway. I only see options for Outlook. Is there a solution?

Thanks,
Dutchcub
 
If you want to attach the currently edited file to an email, I guess you should write a macro in Word's VBA editor (ALT+F11) that saves the current file and then sends a /MAIL command to thebat.exe
 
Hello,

In The Bat!: Options > Preferences > Applications > Install The Bat! as Simple Mapi request Handler

In Word: File > Send To > ...

MAPI = Mail Application Programming Interface.
 
Thanks for your replies but I can't figure it out.
When I look under Options > Preferences > Applicantions, I don't see Install The Bat! as Simple Mapi request Handler

And Bigg One, I don't know how to do what you suggest. It looks very complicated to me.

Dutchcub
 
Hello,

Take a look again. You must see this function.

In the window Applications, it is the 2nd part, down.
 
I am starting to think I'm not very clever but I really don't see the function 'Install The Bat! as Simple Mapi request Handler'.

I use The Bat Pro 4.0.18. In the Bat I go to Options > Preferences > and then in de left colom I choose 'applications' and really don't see any options. Maybe it has to do with the Dutch translation, I'm not sure.

Dutchcub
 
It has nothing to do with the Dutch translation. I don't see it either, doesn't matter whether I'm using the Dutch interface or the English one.

It might have something to do with the OS you're using. I'm using Vista and I don't se it, even though I do rememeber seeing it with XP (but I haven't checked it with my notebook that's still running XP, so that might prove me wrong)
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Thanks Roelof,

It's a relief that I'm not that stupid after all.  ;)
But I still have no solution. Anyone who can help me with this one?

Thanks,
Dutchcub
 
I don't see it either. I have TB 4.0.18 and Windows Vista. I also really need this function for an auction management software.

Keith
 
Here is how to do it with a word macro. File should be already saved.

In word click Tools -> Macro -> Record new macro
Do some stuff, then stop recording (Tools -> Macro -> Stop recording).

Then click Tools -> Macro -> Macros, select the macro and click Edit, this will open the VBA editor. Delete the code between Sub Macro1() and End Sub, and paste this code there (Sub Macro1() and End Sub  must remain)

Code
    tbPath = "C:\\Program Files\\The Bat!\\thebat.exe"
    ActiveDocument.Save
    a = ActiveDocument.FullName
    tbCMD = "/MAILU=ACCOUNT;P=PASSWORD;F=Outbox;ATTACH=" & Chr(34) & a & Chr(34) & ";EDIT"
    Shell Chr(34) & tbPath & Chr(34) & " " & tbCMD, vbNormalFocus


Modify tbPath to match the path to thebat.exe on your system.

In the line tbCMD = ..., replace ACCOUNT with the name of an account you have in theBat; Replace PASSWORD with the password for that account, or if there is no password, remove "P=PASSWORD;"
Save macro and close VBA editor.

You can assign a keyboard shortcut or a toolbar button to quickly execute the macro.
Result should be a new empty message with the currently edited .doc file attached. You can customize it to do exactly what you need.

 
I really tried this but it is not working. Maybe I'm a bit stupid after all..... :oops:

Thanks anyway!
 
there must be single slashes in the line
tbPath = ....

not sure if I put double slashes, or the board software.
Anyway replace double slashes with single, make sure the path is correct, and that ACCOUNT and PASSWORD are replaced with the correct values.

Also make sure macro is started. For this purpose you may put as a first line

Msgbox "Hello"

and see if the message box appears - if not, the macro does not start


 
Maybe someone want to try this:

   Const wdFormatUnicodeText = 7
   tbPath = "D:\The Bat!\thebat.exe"
   ActiveDocument.SaveAs "c:\windows\temp\" & Name & ".txt", wdFormatUnicodeText
   a = ActiveDocument.FullName
   ActiveDocument.Close
   tbCMD = "/nologo /MAILU=ACCOUNT;F=Outbox;C=" & Chr(34) & a & Chr(34) & ";EDIT"
   Shell Chr(34) & tbPath & Chr(34) & " " & tbCMD, vbNormalFocus

This script don't attach the *.doc file, it pastes text in the e-mail body
Pages: 1