Vicki has attended:
Excel VBA Introduction course
Visual Basic - creating a populated email
Hi, I have created a form which populates a word end product and want to create the same thing to populate an email. I currently have the below for my word documentation and thought I might be able to change the Word.application parts to outlook.application but that doesn't seen to work. I have created an email with bookmarks to refer to but cant' figure out how to make it work with the below. Any help would be really appreciated.
Private Sub CommandButton1_Click()
Dim wapp As Word.Application
Dim wdoc As Word.Document
If Me.OptionButton1 = True Then
Set wapp = CreateObject("Word.Application")
Set wdoc = wapp.Documents.Open("\emeaemeadataAlescoFinancial RisksBusiness OperationsPRKey Information PackGallagherAJG Advised - Wholesale.dotx")
wapp.Visible = True
ElseIf Me.OptionButton2 = True Then
Set wapp = CreateObject("Word.Application")
Set wdoc = wapp.Documents.Open("\emeaemeadataAlescoFinancial RisksBusiness OperationsPRKey Information PackGallagherAJG Advised - Retail New.dotx")
wapp.Visible = True
End If
If Me.OptionButton3 = True Then
wapp.Selection.Goto what:=wdGoToBookmark, Name:="NewRenewal"
wapp.Selection.TypeText Sheet2.Range("b15")
ElseIf Me.OptionButton4 = True Then
wapp.Selection.Goto what:=wdGoToBookmark, Name:="NewRenewal"
wapp.Selection.TypeText Sheet2.Range("b16")
End If
RE: Visual Basic - creating a populated email
Hi Vicki
Please accept my sincere apologises for the delay in replying to this. Your message was posted in an archived section - which we've just run through and found this question.
Can we still support you or did you get an answer from us in a different area.
Kind regards
Richard Bailey
Microsoft Certified Trainer
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector