using a command button to operate a hyperlink

P

Pieman

I have created a custom form which is being publish to the Exchange Org forms
library with some code that is using the advanced properties "tag" field of a
command button control and using this to hyperlink to a document on my
website, however this button is not working when published and read by the
recipient.
the command button is on the read page of the page named "message", the code
is as follows: -
Sub CommandButton1_Click()
Set objWeb = CreateObject("InternetExplorer.Application")
objWeb.Navigate Item.GetInspector.ModifiedFormPages _
("Message").Controls("CommandButton1").Tag
End Sub

The Form properties "send form defination with item" is NOT checked, so I am
assuming that this cannot be causing the problem, is the read page of the
message named differently to the compose page, could this be the reason why.
Can anyone explain why this command button no longer works???
 
S

Sue Mosher [MVP-Outlook]

Does other code on the form run? You can check the MessageClass and Size properties of a received item to confirm that it is not a one-off and thus should run code. Another troubleshooting technique is to put a MsgBox in the procedure to display the value of the Tab property.
 
P

Pieman

Thanks for replying...
I'm new to Outlook forms and got the code from a website..! :)
The only other code that I had on the form was in the same read page
besically performing the same action but from a label instead of a command
button, this also didn't work, this was the reason I was presuming that I
have the page name incorrectly set???
Regarding checking the message class and size properties of the recieved
item, what exactly should I be looking for, I am presuming that the message
class should be set at IPM.Note, which it is?
Could you also specify how to put the message box in to the procedure to
test the tab property, sorry as I said I am new to Outlook forms, so some
details explainations wouldn't go a miss. :)

Cheers
Pieman
 
S

Sue Mosher [MVP-Outlook]

IPM.Note is the standard class for messages. If that's what you're seeing, the form is a one-off and will not run code.

This statement would pop up a message box with the value of the control's Tag property:

MsgBox Item.GetInspector.ModifiedFormPages _
("Message").Controls("CommandButton1").Tag

That assumes that the name of the page is Message and the name of the button is CommandButton1. If you're using different names, you must change them or the code so that they match.

Are these messages in your Inbox? In another user's Inbox? A public folder?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
P

Pieman

Hi again Sue,

OK , from what I have read, as the form is a one-off'd due to it being an
"IPM.Note" message class, how then do I prevent it becoming a one-off form;
the form is currently published in the org forms library?

Regards
Pieman
 
S

Sue Mosher [MVP-Outlook]

Check to make sure that all the fields you use on the form are defined in the form, not just in the folder. See http://www.outlookcode.com/article.aspx?id=29 for best practices.

If that doesn't turn up the culprit, you'll need to start looking at your code -- particularly at what control properties you're setting.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 

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