Created
February 6, 2013 20:35
-
-
Save NewProggie/4725563 to your computer and use it in GitHub Desktop.
Kleines VBS-Skript zum Wordbrief an Kunden schreiben
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Brief_schreiben() | |
Dim word_app As Word.Application | |
Dim word_doc As Word.Document | |
' Aktive Zelle ermitteln und Adresse rausfischen | |
Dim CustomerAddress as string | |
CustomerAddress = Cells(ActiveCell.Row, 4).value | |
If CustomerAddress = "" Then | |
MsgBox "Bitte Kunde auswählen", , "Fehler" | |
Exit Sub | |
End If | |
' Word oeffnen und neues Dokument erstellen | |
Set word_app = New Word.Application | |
Set word_doc = word_app.Documents.Add(DocumentType:=wdNewBlankDocument) | |
' Adresse schreiben | |
word_app.Selection.TypeText CustomerAddress | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment