Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / April 2007

Tip: Looking for answers? Try searching our database.

Creating a checkbox that will autopopulate the CC field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
daphnejean77 - 24 Apr 2007 15:24 GMT
I have created some custom forms within outlook and am now looking to add
some features.  One of the features I have been able to add is a checkbox
that once clicked will stamp a time and user name into a textbox field.  I am
now trying to modify the below script/code to have the checkbox fill in the
CC line with the appropriate email addresses.  So far this is not working and
I am at a loss, please help!
Sub CheckBox1_Click()
Dim objNS
Dim objPage
Dim objControl
Set objNS = Application.GetNamespace("MAPI")
Set objPage = Item.GetInspector.ModifiedFormPages("Order Tracking")
Set objControl = objPage.Controls("TextBox15")
objControl.Text = Now()
Set objControl = objPage.Controls("TextBox16")
objControl.Text = objNS.CurrentUser
Set objControl = Nothing
Set objPage = Nothing
Set objNS = Nothing
End Sub
Sue Mosher [MVP-Outlook] - 24 Apr 2007 16:07 GMT
If you want to set the Cc property, that would be:

   Item.Cc = "some address"

See http://www.outlookcode.com/d/propsyntax.htm 

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

>I have created some custom forms within outlook and am now looking to add
> some features.  One of the features I have been able to add is a checkbox
[quoted text clipped - 16 lines]
> Set objNS = Nothing
> End Sub
daphnejean77 - 25 Apr 2007 20:18 GMT
This worked and the checkbox is autopopulating the CC field, however I have
multiple check boxes and selecting the next checkbox overrides the first one
that was selected.  How do I make it so once a box has been checked the
addresses will stay in the CC line and if another check box is checked it
will be added to the CC line instead of overwriting it?

> If you want to set the Cc property, that would be:
>
[quoted text clipped - 22 lines]
> > Set objNS = Nothing
> > End Sub
Hollis Paul - 25 Apr 2007 21:08 GMT
> How do I make it so once a box has been checked the
> addresses will stay in the CC line and if another check box is checked it
[quoted text clipped - 3 lines]
> >
> >     Item.Cc = "some address"

Item.Mileage = Item.Cc

Item.Cc = Item.Mileage + " ; " + "some address"

--
Hollis Paul
Mukilteo, WA  USA
Sue Mosher [MVP-Outlook] - 25 Apr 2007 22:35 GMT
You can append as well:

   Item.Cc = Item.CC & ";" & "some address"

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

> This worked and the checkbox is autopopulating the CC field, however I have
> multiple check boxes and selecting the next checkbox overrides the first one
[quoted text clipped - 7 lines]
>>
>> See http://www.outlookcode.com/d/propsyntax.htm 

>>    
>> >I have created some custom forms within outlook and am now looking to add
[quoted text clipped - 17 lines]
>> > Set objNS = Nothing
>> > End Sub
daphnejean77 - 25 Apr 2007 21:34 GMT
Thank you so much this worked perfectly.  I am just learning all of this as I
go and you guys have been a huge help.

> I have created some custom forms within outlook and am now looking to add
> some features.  One of the features I have been able to add is a checkbox
[quoted text clipped - 16 lines]
> Set objNS = Nothing
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.