#1
|
|||
|
|||
Newbie - Help - VBA script
Hi,
I am a newbie and was hoping for some help. I have an existing word 2010 document, what I would like to do is get people to either accept or reject (i.e. Click Yes or No) to my Terms & Conditions before opening that Word document. I have used the below code as a test and it works great. But now instead of a pop up box. I need something slightly bigger where I can show the entire Terms & Conditions statement. What I have in mind is, a pop-up form/box that shows the entire T&C statement but with a scroll bar so that users are not overwhelmed with a load of text. Then, simply click Yes or No. Thanks in advance. Aj The code is used and adapted is below: Private Sub Document_Open() Dim wdApp As Word.Application Set wdApp = GetObject(, "Word.Application") Dim TermsConditions As String TermsConditions = MsgBox("Greetings", vbYesNo, "Greetings") If (TermsConditions = vbYes) Then Exit Sub ElseIf (TermsConditions = vbNo) Then wdApp.ActiveDocument.Close End If End Sub |
#2
|
|||
|
|||
Hi there,
Sounds like you need to create a user form with a multiline textbox control to contain the Ts & Cs. Go to your VBE environment (Alt+F11) and right click in the Project Explorer to insert a new UserForm. Use the Toolbox to add shapes for interacting with on your form (controls). If you don't learn enough by reading on how to work with UserForms let me know and I will send you a code stub. If you design the userform, please just let me know the names you give to your controls (objects built on the form) and I will send you code. Good luck! This is how your knowledge will grow and it's fun. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Script Template | __John__ | Word | 0 | 06-24-2016 02:41 PM |
Outlook VBA Script | kcm5153 | Outlook | 1 | 04-07-2015 11:41 PM |
Bolding in script | ksigcajun | Word VBA | 10 | 02-23-2015 08:29 AM |
Help with VBA script | nsyrax | Word VBA | 1 | 01-18-2014 03:38 AM |
[ask] about VB Script + Ms. Project | anak_baru | Project | 2 | 03-10-2009 01:42 AM |