WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 28.12.2008, 12:48   #1
Chrisi99
Inventar
 
Benutzerbild von Chrisi99
 
Registriert seit: 22.12.2002
Alter: 39
Beiträge: 2.644

Mein Computer

Chrisi99 eine Nachricht über ICQ schicken
Standard Outlook aus Access aufrufen und Mail senden

Hallo Leute!

kann mir jemand ein paar gute Tipps geben, wie man Outlook am besten aus Access ansteuert (Office 2007).

Ich würde gerne für gewisse Datenbestände (Mitglieder) Rundmails verfassen und verschicken.

Am Geschicktesten wäre das natürlich aus Access direkt, da ich dann keine Mailinglisten abgleichen etc muss (die Daten werden in Access aktuell gehalten)!

Lg
Chris
____________________________________
Der Unterschied zwischen Theorie und Praxis ist, das es in der Theorie keinen Unterschied zwischen Theorie und Praxis gibt, in der Praxis aber schon.

Wer schreibt, der bleibt!
Chrisi99 ist offline   Mit Zitat antworten
Alt 28.12.2008, 16:22   #2
wbendl
Master
 
Registriert seit: 22.03.2000
Alter: 66
Beiträge: 550


Standard

Hi!

Schau mal da:

http://www.meinews.net/email-t134635.html?amp;


mfg

WB
wbendl ist offline   Mit Zitat antworten
Alt 29.12.2008, 13:25   #3
Martin_H3G
Veteran
 
Benutzerbild von Martin_H3G
 
Registriert seit: 14.10.2005
Ort: 1050 Wien
Alter: 56
Beiträge: 353

Mein Computer

Standard

SendObject Action


You can use the SendObject action to include the specified Microsoft Access datasheet, form, report, module, or data access page in an electronic mail message, where it can be viewed and forwarded. You can include objects in Microsoft Excel 2000 (*.xls), MS-DOS text (*.txt), rich-text (*.rtf), or HTML (*.html) format in messages for Microsoft Exchange, Microsoft Mail, Microsoft Windows for Workgroups mail, or another electronic mail application that uses the Microsoft Mail Applications Programming Interface (MAPI).
If you have an electronic mail application that uses the Vendor Independent Mail (VIM) protocol and have installed and set up the dynamic-link library (Mapivim.dll) that converts MAPI mail messages to the VIM protocol, you can send Microsoft Access objects to the VIM mail application.

Syntax
DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][, bcc][, subject][, messagetext][, editmessage][, templatefile]
The SendObject method has the following arguments.
ArgumentDescriptionobjecttypeOne of the following intrinsic constants: acSendDataAccessPage
acSendForm

acSendModule
acSendNoObject (default)
acSendQuery
acSendReport
acSendTableobjectnameA string expression that's the valid name of an object of the type selected by the objecttype argument. If you want to include the active object in the mail message, specify the object's type with the objecttype argument and leave this argument blank. If you leave both the objecttype and objectname arguments blank (the default constant, acSendNoObject, is assumed for the objecttype argument), Microsoft Access sends a message to the electronic mail application without an included database object. If you run Visual Basic code containing the SendObject method in a library database, Microsoft Access looks for the object with this name first in the library database, then in the current database.outputformatOne of the following intrinsic constants: acFormatDAP
acFormatHTML

acFormatRTF
acFormatTXT
acFormatXLS If you leave this argument blank, Microsoft Access prompts you for the output format.toA string expression that lists the recipients whose names you want to put on the To line in the mail message. Separate the recipient names you specify in this argument and in the cc and bcc arguments with a semicolon ( or with the list separator set on the Number tab of the Regional Settings Properties dialog box in Windows Control Panel. If the recipient names aren't recognized by the mail application, the message isn't sent and an error occurs. If you leave this argument blank, Microsoft Access prompts you for the recipients.ccA string expression that lists the recipients whose names you want to put on the Cc line in the mail message. If you leave this argument blank, the Cc line in the mail message is blank.bccA string expression that lists the recipients whose names you want to put on the Bcc line in the mail message. If you leave this argument blank, the Bcc line in the mail message is blank.subjectA string expression containing the text you want to put on the Subject line in the mail message. If you leave this argument blank, the Subject line in the mail message is blank.messagetextA string expression containing the text you want to include in the body of the mail message, after the object. If you leave this argument blank, the object is all that's included in the body of the mail message.editmessageUse True (–1) to open the electronic mail application immediately with the message loaded, so the message can be edited. Use False (0) to send the message without editing it. If you leave this argument blank, the default (True) is assumed.templatefileA string expression that's the full name, including the path, of the file you want to use as a template for an HTML file.
Martin_H3G ist offline   Mit Zitat antworten
Alt 30.12.2008, 18:52   #4
Chrisi99
Inventar
 
Benutzerbild von Chrisi99
 
Registriert seit: 22.12.2002
Alter: 39
Beiträge: 2.644

Mein Computer

Chrisi99 eine Nachricht über ICQ schicken
Standard

danke für den Auszug, an sich ist es mir klar wie es funktioniert

ich hab nur noch eine Frage (die an sich ja den Basics zugeordnet werden muss):

wenn ich eine Prozedur (etwa das Senden von Emails) aus mehreren Seiten aus aufrufen will, wie muss ich da die Deklaration machen (also das nur einmal deklarieren und dann aus verschiedenen Formularen aufrufen)?

leider ist es schon sehr lang her, dass ich VB for Access programmiert habe ... (jaja, die Schule)

danke für die Hilfe!

Lg
Chris
____________________________________
Der Unterschied zwischen Theorie und Praxis ist, das es in der Theorie keinen Unterschied zwischen Theorie und Praxis gibt, in der Praxis aber schon.

Wer schreibt, der bleibt!
Chrisi99 ist offline   Mit Zitat antworten
Alt 30.12.2008, 21:08   #5
wbendl
Master
 
Registriert seit: 22.03.2000
Alter: 66
Beiträge: 550


Standard

Hi!

Ich bin nicht ganz sicher, ob ich dich richtig verstanden habe.

Grundsätzlich sollte der Code in einem Modul stehen. Damit ist er aus allen Objekten erreichbar. Wenn unterschiedliche Inhalte möglich sein sollen, muß der Inhalt, oder dessen Definition als Parameter übergeben werden.


mfg

WB
wbendl ist offline   Mit Zitat antworten
Alt 31.12.2008, 01:00   #6
Martin_H3G
Veteran
 
Benutzerbild von Martin_H3G
 
Registriert seit: 14.10.2005
Ort: 1050 Wien
Alter: 56
Beiträge: 353

Mein Computer

Standard

Ich zitiere:
In Microsoft Access 97 können Sie eine öffentliche Prozedur in einem Formular- oder Berichtsmodul von jeder beliebigen Prozedur der aktuellen Datenbank aus aufrufen. Geben Sie hierzu für die Prozedur den Klassennamen des Formular- oder Berichtsmoduls an. Beispielsweise können Sie die Prozedur AnzeigeMeldung, die im Modul des Formulars Bestellungen definiert ist, folgendermaßen aufrufen:
Form_Bestellungen.AnzeigeMeldung
Fügen Sie Prozeduren, die außerhalb eines Formulars oder Berichts aufgerufen werden, am besten einem Standardmodul und nicht einem Formular- oder Berichtsmodul hinzu."
und
"Verwenden der Public-Anweisung
Sie können die Public-Anweisung zur Deklaration öffentlicher Variablen auf Modulebene verwenden.
Public strName As String
Öffentliche Variablen können in allen Prozeduren des Projekts verwendet werden. Wenn eine öffentliche Variable in einem Standardmodul oder einem Klassenmodul deklariert wird, kann diese auch in allen Projekten verwendet werden, die auf das Projekt verweisen, in dem die öffentliche Variable deklariert wurde."
Martin_H3G ist offline   Mit Zitat antworten
Alt 31.12.2008, 10:29   #7
Chrisi99
Inventar
 
Benutzerbild von Chrisi99
 
Registriert seit: 22.12.2002
Alter: 39
Beiträge: 2.644

Mein Computer

Chrisi99 eine Nachricht über ICQ schicken
Standard

ich hab jetzt mal folgenden Code gewurschtelt (aus einem Beispiel):

Code:
Public Sub Befehl10_Click()

    Dim myMail      As Outlook.MailItem
    Dim myOutlApp   As Outlook.Application

    Set myOutlApp = New Outlook.Application
    Set myMail = myOutlApp.CreateItem(olMailItem)

    With myMail
        
        .To = "me@inode.at"
       
       
        .Subject = "betreff"
         .Body = "test"
          ' Die Email abschicken
        .Send
        

    End With

    ' Die Outlook-Instanz beenden
    myOutlApp.Quit

    ' Objektvariablen zerstören und Speicher freigeben
    Set myMail = Nothing
    Set myOutlApp = Nothing

End Sub
Jedoch muss man ja wirklich bei jeder Mail Outlook den Zugriff gewähren... (sehr nervig). Gibts da ein Workaround?
____________________________________
Der Unterschied zwischen Theorie und Praxis ist, das es in der Theorie keinen Unterschied zwischen Theorie und Praxis gibt, in der Praxis aber schon.

Wer schreibt, der bleibt!
Chrisi99 ist offline   Mit Zitat antworten
Alt 31.12.2008, 11:44   #8
wbendl
Master
 
Registriert seit: 22.03.2000
Alter: 66
Beiträge: 550


Standard

Hi!

Ich verwende fast identischen Code in VB6 mit Outlook 2003. Da gibt es keine Rückfrage. Daraus ist zu schließen, daß es entweder an der Version oder an der Konfiguration liegen dürfte.

Entgegen aller Informationen, die ich im Netz gefunden hatte, kann ich auch den Absender verändern (Natürlich nur im Bereich der Konten, für die ich berechtigt bin).


mfg

WB
wbendl ist offline   Mit Zitat antworten
Alt 31.12.2008, 12:12   #9
Chrisi99
Inventar
 
Benutzerbild von Chrisi99
 
Registriert seit: 22.12.2002
Alter: 39
Beiträge: 2.644

Mein Computer

Chrisi99 eine Nachricht über ICQ schicken
Standard

das kommt bei mir: (Office 2003 mit service pack 3):
Angehängte Grafiken
Dateityp: jpg outlook.jpg (44,6 KB, 8x aufgerufen)
____________________________________
Der Unterschied zwischen Theorie und Praxis ist, das es in der Theorie keinen Unterschied zwischen Theorie und Praxis gibt, in der Praxis aber schon.

Wer schreibt, der bleibt!
Chrisi99 ist offline   Mit Zitat antworten
Alt 31.12.2008, 15:46   #10
Martin_H3G
Veteran
 
Benutzerbild von Martin_H3G
 
Registriert seit: 14.10.2005
Ort: 1050 Wien
Alter: 56
Beiträge: 353

Mein Computer

Standard

Mögliche Lösungen:
In Outlook Express (WinXP) findet sich unter Extras-Optionen-Sicherheit der bereits genannte Punkt 'Warnung anzeigen, wenn andere Anwendungen ...'. Wenn aus Access heraus mit

Application.DoCmd.SendObject acSendNoObject, , , _
"Mailadresse@Zieldomain", "", "", "Hello You", "I want to send this mail", False

die Mail verschickt werden, kommt die geschilderte Meldung, falls der Haken drin ist ... bei entferntem Haken verschwindet die Meldung.

oder:

http://www.express-soft.com/mailmate/clickyes.html

oder:

Weitere Informationen darüber, wie sich der Outlook-E-Mail-Sicherheitsupdate auf andere Microsoft Office-Produkte auswirken kann, finden Sie in dem Ihrer Outlook-Version entsprechenden Artikel der Microsoft Knowledge Base:
290499 (http://support.microsoft.com/kb/290499/DE/ ) Administratorinformationen zu E-Mail-Sicherheitsfeatures
262634 (http://support.microsoft.com/kb/262634/DE/ ) OL2000: Bekannte Probleme beim Outlook E-Mail-Sicherheitsupdate
262618 (http://support.microsoft.com/kb/262618/DE/ ) OL98: Bekannte Probleme mit dem Outlook E-Mail-Sicherheitsupdate
Weitere Informationen zur Deinstallation dieses Sicherheitsupdates finden Sie auf der folgenden Microsoft-Website:
http://office.microsoft.com/de-de/outlook/HA010550011031.aspx (http://office.microsoft.com/de-de/ou...550011031.aspx)

oder:

dieses Sicherheitsfeature ist mit Outlook-Bordmitteln nicht deaktivierbar. Das Add-In
Advanced Security for Outlook
berfreit dich aber von diesen nervigen Meldungen
Martin_H3G ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 23:43 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag