![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Thanks Eric
but I cannot handle the macro it says Anweisung erwartet in line nr where is: Dim objDoc As Word.Document, objWApp As Word.Application I have a macro1 in word: Sub Makro1() ' ' Makro1 Makro ' Selection.EndKey Unit:=wdStory NormalTemplate.AutoTextEntries("Mail Aktuell").Insert Whe=Selection. _ Range, RichText:=True Selection.HomeKey Unit:=wdStory End Sub how can I start this macro in the OL code of the button: 'BUTTON 10 AKTUELL Sub CommandButton10_Click '--------- Dim Nachricht Dim Adresse Dim Text Item.Body = Item.Body & Date() & " " + "Mail Aktuell verschickt" + ": " + strUser & vbCrLf '--------- Set Nachricht = Application.CreateItem(olMailItem) Nachricht.Subject = "XXXXXXX" Nachricht.To = Item.Email1Address ' Nachricht.CC = "" Nachricht.Attachments.Add "C:\Dokumente und Einstellungen\1.pdf" Nachricht.Attachments.Add "C:\Dokumente und Einstellungen\2.pdf" Nachricht.Attachments.Add "C:\Dokumente und Einstellungen\3.pdf" Adresse = Item.CompanyName + vbCr Adresse = Adresse + Item.BusinessAddressStreet + vbCr Adresse = Adresse + Item.BusinessAddressPostalCode + " " Adresse = Adresse + Item.BusinessAddressCity + vbCr + vbCr Adresse = Adresse + Item.Title + " " + Item.LastName + vbCr + vbCr Nachricht.Body = Adresse Text = "Guten Tag " + Item.Title + " " + Item.LastName + "," + vbCr + vbCr Nachricht.Body = Nachricht.Body + Text Nachricht.Categories = "Geschäftlich" Nachricht.Importance = olImportanceNormal 'Nachricht.Send Nachricht.Display end Sub where to put the start of the macro1 which is in word??? and how to start this macro 1 maybe you could help me again Thanks "Eric Legault [MVP - Outlook]" schrieb im Newsbeitrag ... You can use something like the macro below; just change the AutoTextEntries.Item to the entry you need: Sub WordMailInsertAutoText() On Error GoTo EH: Dim objDoc As Word.Document, objWApp As Word.Application Dim objM As Outlook.MailItem Dim objI As Outlook.Inspector Set objM = ActiveInspector.CurrentItem Set objI = ActiveInspector Set objDoc = objI.WordEditor Set objWApp = objDoc.Application objWApp.Templates.Item(1).AutoTextEntries.Item(1). Insert objWApp.Selection.Range Set objWApp = Nothing Set objI = Nothing Set objM = Nothing Set objDoc = Nothing EH: If Err.Number 0 Then Debug.Print Err.Description Stop Resume Next End If End Sub -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Laie" wrote: Hi In an OL contact form I open a new mail with a button - fill in name and adress - now i want to go to the end of the mail and fill in autotext at the cursor position. I recorded a macro in word that is doin this. i dont know how to start this macro fom the code of the form. can anyone tell me how to do call macro ????? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
no automatic fill of from-field | erik | Outlook - General Queries | 4 | February 22nd 06 01:42 PM |
OL2003 - can you auto-fill a singel new contact form with online form data | TimR | Outlook - Using Contacts | 1 | February 15th 06 02:43 PM |
fill in Autotext per code | Laie | Outlook - Using Forms | 3 | January 16th 06 10:51 PM |
How do I get my XP Pro Outlook to auto fill email addresses? | Rick | Outlook - General Queries | 1 | January 15th 06 04:36 PM |
zip code | tn10 | Outlook - Using Contacts | 0 | January 13th 06 05:21 PM |