Template with checkbox and textbox - how to code

N

Nirav

Hello,
I'm not not a programmer, so thought of pitching my question here.
In this template,there is a series of check boxes and only one would be selected at any given time, and a textbox where additional comments will be added. I have inserted objects (check boxes and a text box) - how to make it functional? In properties or in VBA subroutines?

Thanks -
 
P

Peter Hewett

Hi Nirav

From the sound of it you should be using OptionButton controls and not CheckBox controls.
OptionButton controls are designed so that *only* one of a group can be selected at any
one time, whereas you can have any number of CheckBox controls selected (or not).

Check out the following link for help with you form, there's lots of other good info as
well:

http://word.mvps.org/FAQs/index.htm

When you view the above page select the "UserForm" tab.

HTH + Cheers - Peter
 
N

Nirav

Peter,

Thank you for the reply.

Template is ready now! But one more question!

I want to add a "send" button to this template, so that when clicked, a save dialog box pops up to save as a file (.doc) on a local hard-drive in a pre-determined folder for my record and simultaneously email this file (.doc) only (without "send" button) to a my manager (to a specified email address/addresses) using non-Microsoft default email client (Lotus Notes) as an attachment with an auto-populate subject line (where account number, date and time taken from the fields in document). i.e. - "Incoming call for ABC funds received: <account number> @ <date/time>". Where account number and date are the fields in template (or saved .doc file).

Any suggestions? Thanks in advance

Nirav
 
P

Peter Hewett

Hi Nirav

I've not worked with Notes. But have you tried the RoutingSlip method? If not, check out
the following link, it's easy to try:

How to send an email from Word using VBA
http://word.mvps.org/FAQs/InterDev/SendMail.htm

If that doesn't work I don't know if there is an easy way by referencing a Notes library
code module as you would with Outlook. If all that fails you should be able to use MAPI
via the CDONTS library (Microsoft CDO for NTS 1.2 Library). You can Google on this and
get lots of hits!

You an use or adapt this to save a file:

Public Sub SaveTheCurrentFile()
Dim strPath As String

' Set the path your want to use here
strPath = "c:\Temp\"

With Application.Dialogs(wdDialogFileSaveAs)
.Name = vbNullString
.Display

' If the filename is 0 characters long then the user cancelled the dialog
If LenB(.Name) > 0 Then

' Save the file to the standard path with the given name
ActiveDocument.SaveAs strPath & .Name
End If
End With
End Sub ' SaveTheCurrentFile

As to removing a button if you are using a UserForm then the form will not be visible. If
you are using embedded ActiveX object in your document then the there is a solution but
it's convoluted.

HTH + Cheers - Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top