ShellExecute and Outlook

ShellExecute and Outlook

Postby Wanderson » Sat Mar 07, 2009 12:11 am

Hi all
How i can run outlook and simulate send/receive button?
I use this to run outlook

SHELLEXECUTE(nil,"open","outlook")

Thanks in advance.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: ShellExecute and Outlook

Postby ukoenig » Sat Mar 07, 2009 12:23 am

Hello Wanderson,

You can use a VB-Script if Your SCRIPTING-HOST is not disabled.
Nearly everything is possible. There are many examples in the Internet.

You can execute the WSH with the Script from inside Your application.

Have a look at this post :
viewtopic.php?f=3&t=14671

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: ShellExecute and Outlook

Postby Wanderson » Sat Mar 07, 2009 1:44 pm

ukoenig wrote:Hello Wanderson,

You can use a VB-Script if Your SCRIPTING-HOST is not disabled.
Nearly everything is possible. There are many examples in the Internet.

You can execute the WSH with the Script from inside Your application.

Have a look at this post :
http://fivetechsupport.com/forums/viewt ... =3&t=14671

Regards
Uwe :lol:


Thanks ukoening,
I found this in google:

Set Btn = Application.ActiveExplorer.CommandBars.FindControl(1, 7095)
Btn.Execute

But a receive this error:

Script: C:\VBS\SEND.VBS
Line : 1
Caract: 1
Error : Object necessary: 'Application'
Code : 800A01A8
Error in time execution Microsoft VBScript

Can you help me please?

Thanks in advance.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: ShellExecute and Outlook

Postby ukoenig » Sat Mar 07, 2009 4:05 pm

Hello Wanderson,

I found a very interesting web-site

http://www.vbsedit.com

You can download this special editor.
A few hundred examples can displayed and used inside the editor.
Maybe a little help.

Image

The automatic button-execution in outlook I will check.

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: ShellExecute and Outlook

Postby ukoenig » Sat Mar 07, 2009 7:22 pm

Hello Wanderson,

You can use SHELLEXECUTE(nil,"open","outlook /....... ") as well

I can do a english translation if needed
If you can explain in english, the switches You need, I can translate them to english.
Parameterlist for OUTLOOK ShellExecute ( for the moment only in German
/a
Erstellt ein Element, das die angegebene Datei als Anlage enthält.
Example :
"C:\Programme\Microsoft Office\Office11\Outlook.exe" /a "C:\Eigene Dateien\labels.doc"
Wenn kein Elementtyp angegeben ist, wird vom Typ IPM.Note ausgegangen. Kann nur mit Nachrichtenklassen verwendet werden, die auf Outlook basieren.
/altvba OTM-Dateiname
Öffnet das VBA-Programm, das unter OTM-Dateiname angegeben ist, anstelle von %AnwDaten%\Microsoft\Outlook\VbaProject.OTM.
/autorun Makroname
Öffnet Outlook, und führt sofort das unter Makroname angegebene Makro aus.
/c Nachrichtenklasse
Erstellt ein neues Element der angegebenen Nachrichtenklasse (Outlook-Formular oder ein anderes gültiges MAPI-Formular).
Beispiele:
/c ipm.activity erstellt einen Journaleintrag
/c ipm.appointment erstellt einen Termin
/c ipm.contact erstellt einen Kontakt
/c ipm.note erstellt eine E-Mail-Nachricht
/c ipm.stickynote erstellt eine Notiz
/c ipm.task erstellt eine Aufgabe

/checkclient
Fragt nach dem Standardmanager für E-Mail, Nachrichten und Kontakte.
/cleanclientrules
Startet Outlook und löscht clientbasierte Regeln.
/cleandmrecords
Löscht die Protokolleinträge, die gespeichert werden, wenn ein Manager oder eine Stellvertretung eine Besprechung ablehnt.
/cleanfinders
Entfernt Suchordner aus dem Microsoft Exchange-Serverspeicher.
/cleanfreebusy
Löscht Frei/Gebucht-Informationen, und erstellt sie neu. Dieser Parameter kann nur verwendet werden, wenn Sie eine Verbindung zum Microsoft Exchange-Server herstellen können.
/cleanprofile
Entfernt ungültige Profilschlüssel und erstellt standardmäßige Registrierungsschlüssel bei Bedarf neu.
/cleanpst
Startet Outlook mit einer leeren Persönliche Ordner-Datei (*.pst) (Persönliche Ordner-Datei (PST): Datendatei zum Speichern von Nachrichten und anderen Elementen auf dem Computer. Sie können festlegen, dass eine PST-Datei der Standardübermittlungsort für E-Mail-Nachrichten sein soll. In einer PST-Datei können Sie Elemente verwalten und sichern.).
/cleanreminders
Löscht Erinnerungen, und erstellt sie neu.
/cleanrules
Startet Outlook und löscht client- und serverbasierte Regeln.
/cleanschedplus
Löscht alle Schedule+-Daten (Frei/Gebucht-Informationen, Berechtigungen und CAL-Datei) vom Server, und aktiviert die Einstellung, dass die Frei/Gebucht-Informationen aus dem Outlook-Kalender von allen Schedule+ 1.0-Benutzern angezeigt und verwendet werden können.
/cleanserverrules
Startet Outlook und löscht serverbasierte Regeln.
/cleansniff
Löscht doppelt vorhandene Erinnerungsnachrichten.
/cleansubscriptions
Löscht Abonnementnachrichten und Eigenschaften für Abonnementfeatures.
/cleanviews
Stellt Standardansichten wieder her. Alle von Ihnen erstellten benutzerdefinierten Ansichten gehen verloren.
/designer
Startet Outlook, ohne festzustellen, ob Outlook bei der ersten Ausführung als Standardclient verwendet werden sollte.
/embedding
Öffnet die angegebene Nachrichtendatei (*.msg) als OLE-Einbettung. Wird auch ohne Befehlszeilenparameter für die standardmäßige OLE-Erstellung verwendet.
/explorer
Öffnet das neue Fenster im Explorer-Modus (Hyperlinkleiste aktiviert).
/f MSG-Dateiname
Öffnet die angegebene Nachrichtendatei (*.msg) oder die gespeicherte Microsoft Office-Suche (*.oss).
/firstrun
Startet Outlook wie bei der ersten Ausführung.
/folder
Öffnet ein neues Fenster im Ordnermodus (Navigationsbereich deaktiviert).
/hol HOL-Dateiname
Öffnet die angegebene HOL-Datei.
/ical ICS-Dateiname
Öffnet die angegebene ICS-Datei.
/importprf PRF-Dateiname
Startet Outlook, und öffnet bzw. importiert das definierte MAPI-Profil (*.prf). Wenn Outlook bereits geöffnet ist, wird das Profil in der Warteschlange gespeichert und beim nächsten Programmstart importiert.
/l OLK-Dateiname
Öffnet die angegebene OLK-Datei.
/launchtraininghelp Posten-Nr
Öffnet ein Hilfefenster mit dem unter Posten-Nr angegebenen Hilfethema.
/m E-Mail-Name
Ermöglicht dem Benutzer, einen E-Mail-Namen zum Element hinzuzufügen. Ist nur zusammen mit dem Befehlszeilenparameter /c funktionsfähig.
Beispiel:
Outlook.exe /c ipm.note /m E-Mail-Name
/nocustomizeStartet Outlook, ohne die Dateien outcmd.dat (benutzerdefinierte Symbolleisten) und *.fav zu laden.
/noextensions
Startet Outlook mit deaktivierten Erweiterungen, die jedoch im Add-In-Manager aufgeführt werden.
/nopollmail
Startet Outlook, ohne beim Starten Nachrichten zu übermitteln.
/nopreview
Startet Outlook mit deaktiviertem Lesebereich.
/p MSG-Dateiname
Druckt die angegebene Nachricht (*.msg). Ist nicht mit HTML funktionsfähig.
/profile Profilname
Lädt das angegebene Profil. Wenn der Profilname ein Leerzeichen enthält, müssen Sie ihn in Anführungszeichen (") einschließen.
/profiles
Öffnet das Dialogfeld Profil auswählen, unabhängig von der Einstellung für Optionen im Menü Extras.
/recycle
Startet Outlook ggf. mithilfe eines vorhandenen Outlook-Fensters. Wird zusammen mit /explorer oder /folder verwendet.
/resetfoldernames
Setzt Standardordnernamen (wie Posteingang oder Gesendete Objekte) auf die Standardnamen zurück. Dabei wird die aktuelle Sprache der Office-Benutzeroberfläche verwendet.
Wenn Sie beispielsweise erstmals eine Verbindung zum Outlook-Postfach mithilfe einer russischen Benutzeroberfläche herstellen, können die russischen Standardordnernamen nicht umbenannt werden. Um die Namen der Standardordner in eine andere Sprache zu ändern, wie z. B. Japanisch oder Englisch, können Sie mithilfe dieses Parameters die Standardordnernamen zurücksetzen, nachdem Sie die Sprache der Benutzeroberfläche geändert oder eine Outlook-Version in einer anderen Sprache installiert haben.
/resetfolders
Stellt fehlende Ordner für den Standardübermittlungsort wieder her.
/resetnavpane
Löscht den Navigationsbereich für das aktuelle Profil und stellt ihn neu her.
/rpcdiag
Öffnet Outlook und zeigt das Dialogfeld mit dem Verbindungsstatus für Remoteprozeduraufrufe (RPC) an.
/s Dateiname
Lädt die angegebene Verknüpfungsdatei (*.fav).
/safe
Startet Outlook ohne Erweiterungen, Lesebereich und benutzerdefinierte Symbolleisten.
/safe:1
Startet Outlook mit deaktiviertem Lesebereich.
/safe:2
Startet Outlook, ohne beim Starten Nachrichten zu übermitteln.
/safe:3
Startet Outlook mit deaktivierten Erweiterungen, die jedoch im Add-In-Manager aufgeführt werden.
/safe:4
Startet Outlook, ohne die Dateien Outcmd.dat (benutzerdefinierte Symbolleisten) und *.fav zu laden.
/select Ordnername
Startet Outlook und öffnet den angegebenen Ordner in einem neuen Fenster. Beispiel: Verwenden Sie "C:\Programme\Microsoft Office\Office11\Outlook.exe" /select outlook:Kalender, um Outlook zu öffnen und den Standardkalender anzuzeigen.
/sniff
Startet Outlook und erzwingt die Erkennung neuer Besprechungsanfragen im Posteingang. Diese neuen Anfragen werden dann zum Kalender hinzugefügt.
/t OFT-Dateiname
Öffnet die angegebene OFT-Datei.
/v VCF-Dateiname
Öffnet die angegebene VCF-Datei.
/vcal VCS-Dateiname
Öffnet die angegebene VCS-Datei.
/x XNK-Dateiname
Öffnet die angegebene XNK-Date

Regards
Uwe :lol:
Last edited by ukoenig on Sat Mar 07, 2009 10:25 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: ShellExecute and Outlook

Postby Wanderson » Sat Mar 07, 2009 8:59 pm

ukoenig wrote:Hello Wanderson,

You can use SHELLEXECUTE(nil,"open","outlook /....... ") as well

I can do a english translation if needed
If you can explain in english, the switches You need, I can translate them to english.
Parameterlist for OUTLOOK ShellExecute ( for the moment only in German
/a
Erstellt ein Element, das die angegebene Datei als Anlage enthält.
Example :
"C:\Programme\Microsoft Office\Office11\Outlook.exe" /a "C:\Eigene Dateien\labels.doc"
Wenn kein Elementtyp angegeben ist, wird vom Typ IPM.Note ausgegangen. Kann nur mit Nachrichtenklassen verwendet werden, die auf Outlook basieren.
/altvba OTM-Dateiname
Öffnet das VBA-Programm, das unter OTM-Dateiname angegeben ist, anstelle von %AnwDaten%\Microsoft\Outlook\VbaProject.OTM.
/autorun Makroname
Öffnet Outlook, und führt sofort das unter Makroname angegebene Makro aus.
/c Nachrichtenklasse
Erstellt ein neues Element der angegebenen Nachrichtenklasse (Outlook-Formular oder ein anderes gültiges MAPI-Formular).
Beispiele:
/c ipm.activity erstellt einen Journaleintrag
/c ipm.appointment erstellt einen Termin
/c ipm.contact erstellt einen Kontakt
/c ipm.note erstellt eine E-Mail-Nachricht
/c ipm.stickynote erstellt eine Notiz
/c ipm.task erstellt eine Aufgabe


/checkclient
Fragt nach dem Standardmanager für E-Mail, Nachrichten und Kontakte.
/cleanclientrules
Startet Outlook und löscht clientbasierte Regeln.
/cleandmrecords
Löscht die Protokolleinträge, die gespeichert werden, wenn ein Manager oder eine Stellvertretung eine Besprechung ablehnt.
/cleanfinders
Entfernt Suchordner aus dem Microsoft Exchange-Serverspeicher.
/cleanfreebusy
Löscht Frei/Gebucht-Informationen, und erstellt sie neu. Dieser Parameter kann nur verwendet werden, wenn Sie eine Verbindung zum Microsoft Exchange-Server herstellen können.
/cleanprofile
Entfernt ungültige Profilschlüssel und erstellt standardmäßige Registrierungsschlüssel bei Bedarf neu.
/cleanpst
Startet Outlook mit einer leeren Persönliche Ordner-Datei (*.pst) (Persönliche Ordner-Datei (PST): Datendatei zum Speichern von Nachrichten und anderen Elementen auf dem Computer. Sie können festlegen, dass eine PST-Datei der Standardübermittlungsort für E-Mail-Nachrichten sein soll. In einer PST-Datei können Sie Elemente verwalten und sichern.).
/cleanreminders
Löscht Erinnerungen, und erstellt sie neu.
/cleanrules
Startet Outlook und löscht client- und serverbasierte Regeln.
/cleanschedplus
Löscht alle Schedule+-Daten (Frei/Gebucht-Informationen, Berechtigungen und CAL-Datei) vom Server, und aktiviert die Einstellung, dass die Frei/Gebucht-Informationen aus dem Outlook-Kalender von allen Schedule+ 1.0-Benutzern angezeigt und verwendet werden können.
/cleanserverrules
Startet Outlook und löscht serverbasierte Regeln.
/cleansniff
Löscht doppelt vorhandene Erinnerungsnachrichten.
/cleansubscriptions
Löscht Abonnementnachrichten und Eigenschaften für Abonnementfeatures.
/cleanviews
Stellt Standardansichten wieder her. Alle von Ihnen erstellten benutzerdefinierten Ansichten gehen verloren.
/designer
Startet Outlook, ohne festzustellen, ob Outlook bei der ersten Ausführung als Standardclient verwendet werden sollte.
/embedding
Öffnet die angegebene Nachrichtendatei (*.msg) als OLE-Einbettung. Wird auch ohne Befehlszeilenparameter für die standardmäßige OLE-Erstellung verwendet.
/explorer
Öffnet das neue Fenster im Explorer-Modus (Hyperlinkleiste aktiviert).
/f MSG-Dateiname
Öffnet die angegebene Nachrichtendatei (*.msg) oder die gespeicherte Microsoft Office-Suche (*.oss).
/firstrun
Startet Outlook wie bei der ersten Ausführung.
/folder
Öffnet ein neues Fenster im Ordnermodus (Navigationsbereich deaktiviert).
/hol HOL-Dateiname
Öffnet die angegebene HOL-Datei.
/ical ICS-Dateiname
Öffnet die angegebene ICS-Datei.
/importprf PRF-Dateiname
Startet Outlook, und öffnet bzw. importiert das definierte MAPI-Profil (*.prf). Wenn Outlook bereits geöffnet ist, wird das Profil in der Warteschlange gespeichert und beim nächsten Programmstart importiert.
/l OLK-Dateiname
Öffnet die angegebene OLK-Datei.
/launchtraininghelp Posten-Nr
Öffnet ein Hilfefenster mit dem unter Posten-Nr angegebenen Hilfethema.
/m E-Mail-Name
Ermöglicht dem Benutzer, einen E-Mail-Namen zum Element hinzuzufügen. Ist nur zusammen mit dem Befehlszeilenparameter /c funktionsfähig.
Beispiel:
Outlook.exe /c ipm.note /m E-Mail-Name
/nocustomizeStartet Outlook, ohne die Dateien outcmd.dat (benutzerdefinierte Symbolleisten) und *.fav zu laden.
/noextensions
Startet Outlook mit deaktivierten Erweiterungen, die jedoch im Add-In-Manager aufgeführt werden.
/nopollmail
Startet Outlook, ohne beim Starten Nachrichten zu übermitteln.
/nopreview
Startet Outlook mit deaktiviertem Lesebereich.
/p MSG-Dateiname
Druckt die angegebene Nachricht (*.msg). Ist nicht mit HTML funktionsfähig.
/profile Profilname
Lädt das angegebene Profil. Wenn der Profilname ein Leerzeichen enthält, müssen Sie ihn in Anführungszeichen (") einschließen.
/profiles
Öffnet das Dialogfeld Profil auswählen, unabhängig von der Einstellung für Optionen im Menü Extras.
/recycle
Startet Outlook ggf. mithilfe eines vorhandenen Outlook-Fensters. Wird zusammen mit /explorer oder /folder verwendet.
/resetfoldernames
Setzt Standardordnernamen (wie Posteingang oder Gesendete Objekte) auf die Standardnamen zurück. Dabei wird die aktuelle Sprache der Office-Benutzeroberfläche verwendet.
Wenn Sie beispielsweise erstmals eine Verbindung zum Outlook-Postfach mithilfe einer russischen Benutzeroberfläche herstellen, können die russischen Standardordnernamen nicht umbenannt werden. Um die Namen der Standardordner in eine andere Sprache zu ändern, wie z. B. Japanisch oder Englisch, können Sie mithilfe dieses Parameters die Standardordnernamen zurücksetzen, nachdem Sie die Sprache der Benutzeroberfläche geändert oder eine Outlook-Version in einer anderen Sprache installiert haben.
/resetfolders
Stellt fehlende Ordner für den Standardübermittlungsort wieder her.
/resetnavpane
Löscht den Navigationsbereich für das aktuelle Profil und stellt ihn neu her.
/rpcdiag
Öffnet Outlook und zeigt das Dialogfeld mit dem Verbindungsstatus für Remoteprozeduraufrufe (RPC) an.
/s Dateiname
Lädt die angegebene Verknüpfungsdatei (*.fav).
/safe
Startet Outlook ohne Erweiterungen, Lesebereich und benutzerdefinierte Symbolleisten.
/safe:1
Startet Outlook mit deaktiviertem Lesebereich.
/safe:2
Startet Outlook, ohne beim Starten Nachrichten zu übermitteln.
/safe:3
Startet Outlook mit deaktivierten Erweiterungen, die jedoch im Add-In-Manager aufgeführt werden.
/safe:4
Startet Outlook, ohne die Dateien Outcmd.dat (benutzerdefinierte Symbolleisten) und *.fav zu laden.
/select Ordnername
Startet Outlook und öffnet den angegebenen Ordner in einem neuen Fenster. Beispiel: Verwenden Sie "C:\Programme\Microsoft Office\Office11\Outlook.exe" /select outlook:Kalender, um Outlook zu öffnen und den Standardkalender anzuzeigen.
/sniff
Startet Outlook und erzwingt die Erkennung neuer Besprechungsanfragen im Posteingang. Diese neuen Anfragen werden dann zum Kalender hinzugefügt.
/t OFT-Dateiname
Öffnet die angegebene OFT-Datei.
/v VCF-Dateiname
Öffnet die angegebene VCF-Datei.
/vcal VCS-Dateiname
Öffnet die angegebene VCS-Datei.
/x XNK-Dateiname
Öffnet die angegebene XNK-Date

Regards
Uwe :lol:


Thank you ukoening, but i can't found in parameter relation what i want (send/receive) I tried SHELLEXECUTE(nil,"open","outlook /recycle") but
not work. My germany language is terrible :)
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: ShellExecute and Outlook

Postby ukoenig » Sat Mar 07, 2009 9:25 pm

Hello Wanderson

I installed OUTLOOK on my computer to do some tests by my own.
With just 2 lines, I can test the parameters from the list above.
It is easy now, to find out, how they works. You don't need to compile something.
Just change /..... and execute the file with a dblclick.

This example disables the left-menue in outlook :
Save these 2 lines as TestOutl.vbs

TestOutl.vbs
set wshshell = CreateObject( "WScript.Shell" )
wshshell.Run "outlook.exe /folder"


With FWH we can also send messages to a application.
Maybe it can be a solution for Your problem
---------------------------------------------------------------------
WinExec( "Calc" ) // Let's execute the calculator
MsgInfo( "Now we will close the calculator" )
// Use "Calculator" ( or "calc" ? ) in USA for "Calculadora"
SendMessage( FindWindow( 0, "Calculadora" ), WM_CLOSE )
---------------------------------------------------------------------

English-translations of OUTLOOK-parameters

/a
Creates a Element, with the given file as appendix.
Example :
"C:\Program\Microsoft Office\Office11\Outlook.exe" /a "C:\Files\labels.doc"
Without Element-type, the Type is IPM.Note ausgegangen. Can only be used with message-classes,
based on Outlook.
/altvba OTM-Filename
Opens the VBA-Program, defined with the OTM-Filename, instead of
%AnwDaten%\Microsoft\Outlook\VbaProject.OTM.
/autorun Makroname
Opens Outlook, and executes the Macro.
/checkclient
Asks for the Standardmanager for E-Mail, Messages and Contacs.
/cleanclientrules
Starts Outlook and deletes client-based Rules.
/cleandmrecords
Deletes records are saved, if a Manager or proxy a discusion disclaimes.
/cleanfinders
Deletes the seek-folder from the Microsoft Exchange-Servermemory.
/cleanfreebusy
Deletes Free/Booked-Informations and creates new.
This Parameter only can be used with a possible connection to Microsoft Exchange-Server.
/cleanprofile
Deletes unguilty Profile-keys and creates standard Registry-Keys new if needd.
/cleanpst
Starts Outlook with a empty Personal-folder-file (*.pst) (Personal-Folder-File (PST): Data-File to save messages and other Elements on the Computer. You can define a PST-File as the Standard-transfer-place for E-Mail-messages. In a PST-File, You can archive and save Elements.).
/cleanreminders
Deletes remembers and creates new.
/cleanrules
Starts Outlook and deletes client- and serverbased rules.
/cleanschedplus
Deletes all Schedule+-data (Free/Booked-Informations, Warranty and CAL-File) from Server, and aktivates the setting, that the Free/Booked-Informations from the Outlook-Calender from all
Schedule+ 1.0-Users can displayed and used.
/cleanserverrules
Starts Outlook and deletes serverbased rules.
/cleansniff
Deletes double existing Remember-messages.
/cleansubscriptions
Deletes Abonnement-messages and propertys for Abonnementfeatures.
/cleanviews
Reconstructs Standard-views. All user defined Views are getting lost.
/designer
Starts Outlook, without check, if Outlook can be used at first run as Standardclient.
/embedding
Opens the defined Message-file (*.msg) as embedded OLE. can be used also without
command-line-parameter for the standard OLE-creation.
/f MSG-File-name
Opens the defined Message-file (*.msg) or the saved Microsoft Office-seek (*.oss).
/firstrun
Starts Outlook like at first run.
/hol HOL-Filename
Opens the defined HOL-File.
/ical ICS-Filenam
Opens the defined ICS-file.
/importprf PRF-Filename
Starts Outlook, and opens or imports the defined MAPI-Profile (*.prf). If Outlook allready is open,
the Profile will be saved in the waiting-loop and imported at next start.
/recycle
Starts Outlook with a Outlook-Window. Works together with /explorer or /folder.
/explorer
Opens a new Window in Explorer-Mode (Hyperlink-groin aktivated).
/folder
Opens a new Window in Folder-Mode (Navigation-area deaktivated).
/c Class
Creates a new Element for the defined Class (Outlook-Form or another guilty MAPI-Form).
examples :
/c ipm.activity creates a new Journale-entry
/c ipm.appointment creates a Termin
/c ipm.contact creates a Contact
/c ipm.note creates a E-Mail-Note
/c ipm.stickynote creates a Note
/c ipm.task creates a job

I found in the internet, the use of wshShell.SendKeys for a SCRIPT.
They open a application and sendig a KEY to a application to start a action.
Maybe You can seek in the internet for the words => OUTLOOK SENDKEYS WSH
( WSH or SCRIPTING HOST )

2 Lines to open any application :
---------------------------------------
set wshshell = CreateObject( "WScript.Shell" )
wshshell.Run "Outlook.exe"
---------------------------------------
wshShell.SendKeys "{ ????? }"

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: ShellExecute and Outlook

Postby Wanderson » Sun Mar 08, 2009 8:37 pm

ukoenig wrote:Hello Wanderson

I installed OUTLOOK on my computer to do some tests by my own.
With just 2 lines, I can test the parameters from the list above.
It is easy now, to find out, how they works. You don't need to compile something.
Just change /..... and execute the file with a dblclick.

This example disables the left-menue in outlook :
Save these 2 lines as TestOutl.vbs

TestOutl.vbs
set wshshell = CreateObject( "WScript.Shell" )
wshshell.Run "outlook.exe /folder"


With FWH we can also send messages to a application.
Maybe it can be a solution for Your problem
---------------------------------------------------------------------
WinExec( "Calc" ) // Let's execute the calculator
MsgInfo( "Now we will close the calculator" )
// Use "Calculator" ( or "calc" ? ) in USA for "Calculadora"
SendMessage( FindWindow( 0, "Calculadora" ), WM_CLOSE )
---------------------------------------------------------------------

English-translations of OUTLOOK-parameters

/a
Creates a Element, with the given file as appendix.
Example :
"C:\Program\Microsoft Office\Office11\Outlook.exe" /a "C:\Files\labels.doc"
Without Element-type, the Type is IPM.Note ausgegangen. Can only be used with message-classes,
based on Outlook.
/altvba OTM-Filename
Opens the VBA-Program, defined with the OTM-Filename, instead of
%AnwDaten%\Microsoft\Outlook\VbaProject.OTM.
/autorun Makroname
Opens Outlook, and executes the Macro.
/checkclient
Asks for the Standardmanager for E-Mail, Messages and Contacs.
/cleanclientrules
Starts Outlook and deletes client-based Rules.
/cleandmrecords
Deletes records are saved, if a Manager or proxy a discusion disclaimes.
/cleanfinders
Deletes the seek-folder from the Microsoft Exchange-Servermemory.
/cleanfreebusy
Deletes Free/Booked-Informations and creates new.
This Parameter only can be used with a possible connection to Microsoft Exchange-Server.
/cleanprofile
Deletes unguilty Profile-keys and creates standard Registry-Keys new if needd.
/cleanpst
Starts Outlook with a empty Personal-folder-file (*.pst) (Personal-Folder-File (PST): Data-File to save messages and other Elements on the Computer. You can define a PST-File as the Standard-transfer-place for E-Mail-messages. In a PST-File, You can archive and save Elements.).
/cleanreminders
Deletes remembers and creates new.
/cleanrules
Starts Outlook and deletes client- and serverbased rules.
/cleanschedplus
Deletes all Schedule+-data (Free/Booked-Informations, Warranty and CAL-File) from Server, and aktivates the setting, that the Free/Booked-Informations from the Outlook-Calender from all
Schedule+ 1.0-Users can displayed and used.
/cleanserverrules
Starts Outlook and deletes serverbased rules.
/cleansniff
Deletes double existing Remember-messages.
/cleansubscriptions
Deletes Abonnement-messages and propertys for Abonnementfeatures.
/cleanviews
Reconstructs Standard-views. All user defined Views are getting lost.
/designer
Starts Outlook, without check, if Outlook can be used at first run as Standardclient.
/embedding
Opens the defined Message-file (*.msg) as embedded OLE. can be used also without
command-line-parameter for the standard OLE-creation.
/f MSG-File-name
Opens the defined Message-file (*.msg) or the saved Microsoft Office-seek (*.oss).
/firstrun
Starts Outlook like at first run.
/hol HOL-Filename
Opens the defined HOL-File.
/ical ICS-Filenam
Opens the defined ICS-file.
/importprf PRF-Filename
Starts Outlook, and opens or imports the defined MAPI-Profile (*.prf). If Outlook allready is open,
the Profile will be saved in the waiting-loop and imported at next start.
/recycle
Starts Outlook with a Outlook-Window. Works together with /explorer or /folder.
/explorer
Opens a new Window in Explorer-Mode (Hyperlink-groin aktivated).
/folder
Opens a new Window in Folder-Mode (Navigation-area deaktivated).
/c Class
Creates a new Element for the defined Class (Outlook-Form or another guilty MAPI-Form).
examples :
/c ipm.activity creates a new Journale-entry
/c ipm.appointment creates a Termin
/c ipm.contact creates a Contact
/c ipm.note creates a E-Mail-Note
/c ipm.stickynote creates a Note
/c ipm.task creates a job

I found in the internet, the use of wshShell.SendKeys for a SCRIPT.
They open a application and sendig a KEY to a application to start a action.
Maybe You can seek in the internet for the words => OUTLOOK SENDKEYS WSH
( WSH or SCRIPTING HOST )

2 Lines to open any application :
---------------------------------------
set wshshell = CreateObject( "WScript.Shell" )
wshshell.Run "Outlook.exe"
---------------------------------------
wshShell.SendKeys "{ ????? }"

Regards
Uwe :lol:


ukoening thanks a lot for your help.
This is the way:

set wshshell = CreateObject( "WScript.Shell" )
wshshell.Run "Outlook.exe"
WScript.Sleep(5000) // waits 5 seconds to send a F9 command to outlook (time necessary or F9 command is sent before outlook's load)
wshShell.SendKeys("{F9}")
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: ShellExecute and Outlook

Postby ukoenig » Sun Mar 08, 2009 8:52 pm

Hello Wanderson,

It's nice, that it works for You now.
To keep the source inside Your application, You can use this function :
Inside the function, You can write many scripts called by number.
There is allways only one script inside Your Application-directory.

Code: Select all  Expand view

FUNCTION START_VBS(number)

// Inside a network maybe a filename for each user :
// WNetGetUser() + ".VBS"

IF FILE( "VBSCRIPT.VBS" )
    DELETE FILE  "VBSCRIPT.VBS"
ENDIF

oText := TTxtFile():New( "VBSCRIPT.VBS" )
IF oText:Open()

    // Execute Script by number
    // ------------------------------
    IF number = 1 // Outlook Script
          oText:Add('set wshshell = CreateObject( "WScript.Shell" )')
          oText:Add('wshshell.Run "Outlook.exe"')
          oText:Add('// waits 5 seconds to send a F9 command to outlook')
          oText:Add('// (time necessary or F9 command is sent before outlook's load)')
          oText:Add('
WScript.Sleep(5000)')
          oText:Add('
wshShell.SendKeys("{F9}")')
   ENDIF

ENDIF

Winexec('
WSCRIPT.exe VBSCRIPT.VBS')

RETURN NIL



Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: ShellExecute and Outlook

Postby Wanderson » Mon Mar 09, 2009 1:21 pm

ukoenig wrote:Hello Wanderson,

It's nice, that it works for You now.
To keep the source inside Your application, You can use this function :
Inside the function, You can write many scripts called by number.
There is allways only one script inside Your Application-directory.

Code: Select all  Expand view

FUNCTION START_VBS(number)

// Inside a network maybe a filename for each user :
// WNetGetUser() + ".VBS"

IF FILE( "VBSCRIPT.VBS" )
    DELETE FILE  "VBSCRIPT.VBS"
ENDIF

oText := TTxtFile():New( "VBSCRIPT.VBS" )
IF oText:Open()

    // Execute Script by number
    // ------------------------------
    IF number = 1 // Outlook Script
          oText:Add('set wshshell = CreateObject( "WScript.Shell" )')
          oText:Add('wshshell.Run "Outlook.exe"')
          oText:Add('// waits 5 seconds to send a F9 command to outlook')
          oText:Add('// (time necessary or F9 command is sent before outlook's load)')
          oText:Add('
WScript.Sleep(5000)')
          oText:Add('
wshShell.SendKeys("{F9}")')
   ENDIF

ENDIF

Winexec('
WSCRIPT.exe VBSCRIPT.VBS')

RETURN NIL



Regards
Uwe :lol:


Good idea, thanks a lot.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Willi Quintana and 50 guests