Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intercepting the ATTACH button/CALL to run external APP

Status
Not open for further replies.

MACE1

IS-IT--Management
Jun 26, 2009
2
GB
I have produced an external APP which manages users personal FTP zones rather than let them blindly try to send 10 to 20+ mb email attachments.[Why do people NEVER check sizes?]
Currently it is called manually by the user where they can then Create ZIP/Select ZIP /FTP to their ZONE/Manage old FTP's and have it automatically generate a new email in drafts with all the necessary imbedded links to the file. I have set a threshhold of 512k from attach to 'FTP and Link'.
It works well provided they bl###y use it.
To try to enforce this I would really like to hijack the email attachment button to run this external process in a shell so they have no option !
I have found all sorts of interesting VBA information but to date nothing I can use. Ultimately all I want is to re-direct the code specifically pointing to the attach button to a small vb script which can shell the APP.

Anyone out there done anything like this before ?

NB: VB is not my native or prefered coding language so be gentle !(I tend to use KIX for most things these days !!)
 


Hi,

What application are you executing the VBA from?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
The user will be in OUTLOOK, will probably click NEW Mail then the ATTACH paperclip button. I want to intercept the code behind that paperclip to point to say a VBScript as follows:
Code:
'*************************************************************************
'Execute FTP KIX email Script
'*************************************************************************
Option Explicit
Dim FsoObject, CommandLine
Dim strFileName, winDir, strPF, strFTP

Set FsoObject = wscript.CreateObject("Scripting.FileSystemObject")
Set CommandLine = CreateObject("WScript.Shell")

winDir = CommandLine.ExpandEnvironmentStrings("%windir%")
strPF = CommandLine.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
If not (FsoObject.FolderExists(strPF)) then
 strPF = CommandLine.ExpandEnvironmentStrings("%ProgramFiles%")
End If
strFileName = "\system32\WKIX32.EXE"
strFTP = "\menu\FTP-email.KX" & Chr(34)

If (FsoObject.FileExists(winDir & strFileName)) Then
 If (FsoObject.FileExists(strPF & "\menu\FTP-email.KX")) Then
  'wscript.echo winDir & strFileName & " /i " & chr(34) & strPF & strFTP
  CommandLine.run winDir & strFileName & " /i " & chr(34) & strPF & strFTP, 1
 End If
End If

Set CommandLine = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top