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 / January 2008

Tip: Looking for answers? Try searching our database.

Command Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jsirilla@gmail.com - 17 Jan 2008 15:45 GMT
Hi, I want to write some code for a custom form. I want the user to
click a button and an address book pops up -- the same way an address
book pops up when the user clicks "To...", but I want it to display a
particular set of users/emails, for example "clients."

Is this possible to do with Outlook forms? Any help would be much
appreciated!

Jake
Sue Mosher [MVP-Outlook] - 17 Jan 2008 16:30 GMT
Depending on your Outlook version and configuration, it may be possible to display the Address Book dialog. However, to make it show a specific address list, you would need to use the third-party Redemption library; see http://www.dimastr.com/redemption/rdo/rdoaddressbook.htm

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Hi, I want to write some code for a custom form. I want the user to
> click a button and an address book pops up -- the same way an address
[quoted text clipped - 5 lines]
>
> Jake
jsirilla@gmail.com - 17 Jan 2008 16:58 GMT
Hi Sue, I am getting an error that says "Property is read only" when I
try to execute the code. (It must be obvious I'm not a VB programmer
yet...trying to learn though...sorry if the code is completely off!)

Here is the code:

Sub CommandButton2_Click()

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Inbox = Session.GetDefaultFolder(olFolderInbox)
set Msg = Inbox.Items.Add
Msg.CC = "test1"
Msg.Recipients.ResolveAll
Msg.Subject = "test"
set AB = Session.AddressBook
set Recips = AB.ShowAddressBook(Msg.Recipients)
Msg.Recipients = Recips
Msg.Save

End Sub

On Jan 17, 11:30 am, "Sue Mosher [MVP-Outlook]"
<sue...@outlookcode.com> wrote:
> Depending on your Outlook version and configuration, it may be possible to display the Address Book dialog. However, to make it show a specific address list, you would need to use the third-party Redemption library; seehttp://www.dimastr.com/redemption/rdo/rdoaddressbook.htm
>
[quoted text clipped - 14 lines]
>
> > Jake
jsirilla@gmail.com - 17 Jan 2008 17:00 GMT
Also, by the way, I downloaded and installed the redemption package.
Sue Mosher [MVP-Outlook] - 17 Jan 2008 17:02 GMT
Which statement raises the error?

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Hi Sue, I am getting an error that says "Property is read only" when I
> try to execute the code. (It must be obvious I'm not a VB programmer
[quoted text clipped - 21 lines]
> <sue...@outlookcode.com> wrote:
>> Depending on your Outlook version and configuration, it may be possible to display the Address Book dialog. However, to make it show a specific address list, you would need to use the third-party Redemption library; see http://www.dimastr.com/redemption/rdo/rdoaddressbook.htm

>> <jsiri...@gmail.com> wrote in messagenews:ac2219ba-4fac-46a0-9ec8-c7a270024704@d4g2000prg.googlegroups.com...
>> > Hi, I want to write some code for a custom form. I want the user to
[quoted text clipped - 6 lines]
>>
>> > Jake
jsirilla@gmail.com - 17 Jan 2008 17:24 GMT
When I publish and then run the form, and click on the button, a popup
appears that says "Property is read-only".

I don't know how to debug the code to find out what statement is doing
it :(

On Jan 17, 12:02 pm, "Sue Mosher [MVP-Outlook]"
<sue...@outlookcode.com> wrote:
> Which statement raises the error?
Sue Mosher [MVP-Outlook] - 17 Jan 2008 18:17 GMT
What version of Outlook, on what operating system?

In the meantime, you can add MsgBox statements between each pair of statements to get a sense for which execute before and after the error.

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> When I publish and then run the form, and click on the button, a popup
> appears that says "Property is read-only".
[quoted text clipped - 5 lines]
> <sue...@outlookcode.com> wrote:
>> Which statement raises the error?

<jsirilla@gmail.com> wrote in message news:6db9ea56-b36e-4953-aaa4-718907fa7718@h11g2000prf.googlegroups.com...
> Hi Sue, I am getting an error that says "Property is read only" when I
> try to execute the code. (It must be obvious I'm not a VB programmer
[quoted text clipped - 21 lines]
> <sue...@outlookcode.com> wrote:
>> Depending on your Outlook version and configuration, it may be possible to display the Address Book dialog. However, to make it show a specific address list, you would need to use the third-party Redemption library; see http://www.dimastr.com/redemption/rdo/rdoaddressbook.htm

>> <jsiri...@gmail.com> wrote in messagenews:ac2219ba-4fac-46a0-9ec8-c7a270024704@d4g2000prg.googlegroups.com...
>> > Hi, I want to write some code for a custom form. I want the user to
[quoted text clipped - 4 lines]
>> > Is this possible to do with Outlook forms? Any help would be much
>> > appreciated!
jsirilla@gmail.com - 17 Jan 2008 18:27 GMT
Outlook 2003, Windows XP.

Based on msgBox testing that you suggested, the problem occurs on the
first line:

set Session = CreateObject("Redemption.RDOSession")

On Jan 17, 1:17 pm, "Sue Mosher [MVP-Outlook]"
<sue...@outlookcode.com> wrote:
> What version of Outlook, on what operating system?
>
> In the meantime, you can add MsgBox statements between each pair of statements to get a sense for which execute before and after the error.
Sue Mosher [MVP-Outlook] - 17 Jan 2008 19:44 GMT
Did you download and install the Redemption library?

The error message doesn't match the code statement. That statement is not setting any properties, read-only or otherwise.

This is a more likely problem statement:

   Msg.Recipients = Recips

You cannot set a Recipients collection like that. Instead, you would need to loop through the Recips collection and, for each Recip.Address, call Msg.Recipients.Add to add that recipient to Msg.

To invoke the script debugger from Outlook 2003, open the item and choose Tools | Forms | Script Debugger. Choose New Instance of Microsoft Script Editor. Find your procedure and use the F9 key to place a breakpoint on the first line. When you click the button, code execution should stop at the breakpoint. You can then step through each statement by pressing the F11 key.

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Outlook 2003, Windows XP.
>
[quoted text clipped - 8 lines]
>>
>> In the meantime, you can add MsgBox statements between each pair of statements to get a sense for which execute before and after the error.

<jsirilla@gmail.com> wrote in message news:22f35656-0cf2-43a6-bced-2f045fd88568@e10g2000prf.googlegroups.com...
> When I publish and then run the form, and click on the button, a popup
> appears that says "Property is read-only".
[quoted text clipped - 5 lines]
> <sue...@outlookcode.com> wrote:
>> Which statement raises the error?

<jsirilla@gmail.com> wrote in message news:6db9ea56-b36e-4953-aaa4-718907fa7718@h11g2000prf.googlegroups.com...
> Hi Sue, I am getting an error that says "Property is read only" when I
> try to execute the code. (It must be obvious I'm not a VB programmer
[quoted text clipped - 21 lines]
> <sue...@outlookcode.com> wrote:
>> Depending on your Outlook version and configuration, it may be possible to display the Address Book dialog. However, to make it show a specific address list, you would need to use the third-party Redemption library; see http://www.dimastr.com/redemption/rdo/rdoaddressbook.htm

>> <jsiri...@gmail.com> wrote in messagenews:ac2219ba-4fac-46a0-9ec8-c7a270024704@d4g2000prg.googlegroups.com...
>> > Hi, I want to write some code for a custom form. I want the user to
[quoted text clipped - 4 lines]
>> > Is this possible to do with Outlook forms? Any help would be much
>> > appreciated!
jsirilla@gmail.com - 18 Jan 2008 16:17 GMT
Hi Sue, thanks for the info. However, I noticed even if I delete all
the other lines of code except for the first line, I still get the
read only error. Could it have something to do with my write
privileges on my computer?

I installed redemption using the registry and everything installed
properly, so I don't think that is the issue.

Jake

On Jan 17, 2:44 pm, "Sue Mosher [MVP-Outlook]"
<sue...@outlookcode.com> wrote:
> Did you download and install the Redemption library?
>
[quoted text clipped - 9 lines]
>
> --
Sue Mosher [MVP-Outlook] - 18 Jan 2008 17:25 GMT
Since you didn't include the text of the earlier posts, I don't know what statement is the first line.

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Hi Sue, thanks for the info. However, I noticed even if I delete all
> the other lines of code except for the first line, I still get the
[quoted text clipped - 21 lines]
>>
>> --
jsirilla@gmail.com - 18 Jan 2008 17:35 GMT
Sorry, the line is:

set Session = CreateObject("Redemption.RDOSession")

But you also earlier wrote "The error message doesn't match the code
statement. That statement is not setting any properties, read-only or
otherwise," which leads me to believe the problem is with the way the
Redemption libraries are being accessed by my computer rather than the
line of code itself.

-Jake

On Jan 18, 12:25 pm, "Sue Mosher [MVP-Outlook]"
<sue...@outlookcode.com> wrote:
> Since you didn't include the text of the earlier posts, I don't know what statement is the first line.
>
[quoted text clipped - 30 lines]
>
> >> --
Sue Mosher [MVP-Outlook] - 18 Jan 2008 17:57 GMT
I've never heard of that warning message being associated with that statement. I have no further ideas.  You could reinstall Redemption or drop a line to Redemption's developer.

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Sorry, the line is:
>
[quoted text clipped - 38 lines]
>>
>> >> --
 
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.