Hallo
Ich mache es nun über den Word Editor. Kann mir jemand sagen, wie ich im ganzen Text, meinen zu ersetzenden Text, suchen bzw. finden kann ohne manuell den Text markieren zu müssen? Was ist noch falsch?
Sub Mailbody()
'Word Instanzen aufbauen und setzen
Dim myInspector As Outlook.Inspector
Dim myObject As Object
Dim myItem As Outlook.MailItem
Dim myDoc As Word.Document
Dim mySelection As Word.Selection
Dim strItem As String
Dim strGreeting As String
Set myInspector = Application.ActiveInspector
Set myObject = myInspector.CurrentItem
'----------------------------------------------------------------------
'Ändert die Werte ab
'Grab the body of the message using a Word Document object.
Set myDoc = myInspector.WordEditor
myDoc.Range.Find.ClearFormatting
Set mySelection = myDoc.Application.Selection
With mySelection.Find
.Text = "Wassuch"
.Replacement.Text = WasText
.Execute Replace:=wdReplaceAll
End With
End Sub
|