98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft VBA Training and help » Visual Basic - creating a populated email | VBA forum
Visual Basic - creating a populated email | VBA forum
Resolved · High Priority · Version Standard
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
Mon 26 Apr 2021: Automatically marked as resolved.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
VBA tip:Empty The Clipboard with CutCopyModeAfter each Copy/Paste operation in VBA, you should use the following line of code to empty the clipboard. This ensures that the computer memory doesn't overload: |