PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Form Programming Open Form from Macro

Reply

Open Form from Macro

 
Thread Tools Rate Thread
Old 16-06-2006, 08:32 PM   #1
alexandre.sousa@gmail.com
Guest
 
Posts: n/a
Default Open Form from Macro


Hi,

I've followed the MS KB article to Open Form from a Toolbar Button.

This is the Macro, as I have it in ThisOutlookSession:

Sub DisplayForm()
Set myFolder = Session.GetDefaultFolder(olFolderInbox)
Set myItem = myFolder.Items.Add("IPM.Note.SuppRequest")
myItem.Display
myItem.Recipient.Add ("mail@mail.not")
End Sub

The only difference from the KB Article is the Recipient.Add. However,
my problem is that I got it to work just as I left my Office, and as
soon as I got home never worked again.

Anyone got a clue?

Best Regards,

Alexandre Sousa

  Reply With Quote
Old 16-06-2006, 08:41 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Open Form from Macro

What precisely didn't work? In other words, what happened when you stepped through the code.

In general when creating new items, Display should be your last statement .

--
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

<alexandre.sousa@gmail.com> wrote in message news:1150486356.956797.296190@c74g2000cwc.googlegroups.com...
> Hi,
>
> I've followed the MS KB article to Open Form from a Toolbar Button.
>
> This is the Macro, as I have it in ThisOutlookSession:
>
> Sub DisplayForm()
> Set myFolder = Session.GetDefaultFolder(olFolderInbox)
> Set myItem = myFolder.Items.Add("IPM.Note.SuppRequest")
> myItem.Display
> myItem.Recipient.Add ("mail@mail.not")
> End Sub
>
> The only difference from the KB Article is the Recipient.Add. However,
> my problem is that I got it to work just as I left my Office, and as
> soon as I got home never worked again.
>
> Anyone got a clue?
>
> Best Regards,
>
> Alexandre Sousa
>

  Reply With Quote
Old 16-06-2006, 09:44 PM   #3
alexandre.sousa@gmail.com
Guest
 
Posts: n/a
Default Re: Open Form from Macro

Sue,

Now, when I press the Button created based on the Macro, nothing
happens. The first time, I clicked the button and it showed the form
right away, I filled it, and sent it. Then I could notice Outlook
sending the email. Now, nothings happens at all, after I click the
button.

The reason why I add the recipient last, is because I want to fill the
To: field, which I deleted from the form. This is a tech support
request form. It's supposed to always be delivered to the same address.

I also tried to fill the Initial value field, but once I published the
form and then opened it, the address would get replaced with a date.

I'm kind of lost right now.

Best Regards,

Alexandre Sousa

Sue Mosher [MVP-Outlook] wrote:
> What precisely didn't work? In other words, what happened when you stepped through the code.
>
> In general when creating new items, Display should be your last statement .
>
> --
> 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
>
> <alexandre.sousa@gmail.com> wrote in message news:1150486356.956797.296190@c74g2000cwc.googlegroups.com...
> > Hi,
> >
> > I've followed the MS KB article to Open Form from a Toolbar Button.
> >
> > This is the Macro, as I have it in ThisOutlookSession:
> >
> > Sub DisplayForm()
> > Set myFolder = Session.GetDefaultFolder(olFolderInbox)
> > Set myItem = myFolder.Items.Add("IPM.Note.SuppRequest")
> > myItem.Display
> > myItem.Recipient.Add ("mail@mail.not")
> > End Sub
> >
> > The only difference from the KB Article is the Recipient.Add. However,
> > my problem is that I got it to work just as I left my Office, and as
> > soon as I got home never worked again.
> >
> > Anyone got a clue?
> >
> > Best Regards,
> >
> > Alexandre Sousa
> >


  Reply With Quote
Old 16-06-2006, 09:54 PM   #4
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Open Form from Macro

> Now, when I press the Button created based on the Macro, nothing
> happens.


Repeating: What happens when you step through the macro in the VBA environment?

> The reason why I add the recipient last, is because I want to fill the
> To: field, which I deleted from the form. This is a tech support
> request form. It's supposed to always be delivered to the same address.


No reason why you can't do that before you display it.

--
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

<alexandre.sousa@gmail.com> wrote in message news:1150490669.083807.246850@p79g2000cwp.googlegroups.com...
> Sue,
>
> Now, when I press the Button created based on the Macro, nothing
> happens. The first time, I clicked the button and it showed the form
> right away, I filled it, and sent it. Then I could notice Outlook
> sending the email. Now, nothings happens at all, after I click the
> button.
>
> I also tried to fill the Initial value field, but once I published the
> form and then opened it, the address would get replaced with a date.
>
> I'm kind of lost right now.
>
> Best Regards,
>
> Alexandre Sousa
>
> Sue Mosher [MVP-Outlook] wrote:
>> What precisely didn't work? In other words, what happened when you stepped through the code.
>>
>> In general when creating new items, Display should be your last statement .
>>
>> <alexandre.sousa@gmail.com> wrote in message news:1150486356.956797.296190@c74g2000cwc.googlegroups.com...
>> > Hi,
>> >
>> > I've followed the MS KB article to Open Form from a Toolbar Button.
>> >
>> > This is the Macro, as I have it in ThisOutlookSession:
>> >
>> > Sub DisplayForm()
>> > Set myFolder = Session.GetDefaultFolder(olFolderInbox)
>> > Set myItem = myFolder.Items.Add("IPM.Note.SuppRequest")
>> > myItem.Display
>> > myItem.Recipient.Add ("mail@mail.not")
>> > End Sub
>> >
>> > The only difference from the KB Article is the Recipient.Add. However,
>> > my problem is that I got it to work just as I left my Office, and as
>> > soon as I got home never worked again.
>> >
>> > Anyone got a clue?
>> >
>> > Best Regards,
>> >
>> > Alexandre Sousa
>> >

>

  Reply With Quote
Old 16-06-2006, 10:41 PM   #5
asousa
Guest
 
Posts: n/a
Default Re: Open Form from Macro

Sue,

Your answer did help. I've got little programming background. Even more
so with all the security restrictions nowadays. The problem was that
Outlook had the Macro Security setting set to "High". I found this as I
Googled thru to figure out how to Run the Macro in the VBA environment.

Now I have to figure out how to program a "secure" Macro.

Thanks for the help.

Best Regards,

Alexandre Sousa

Sue Mosher [MVP-Outlook] wrote:
> > Now, when I press the Button created based on the Macro, nothing
> > happens.

>
> Repeating: What happens when you step through the macro in the VBA environment?
>
> > The reason why I add the recipient last, is because I want to fill the
> > To: field, which I deleted from the form. This is a tech support
> > request form. It's supposed to always be delivered to the same address.

>
> No reason why you can't do that before you display it.
>
> --
> 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
>
> <alexandre.sousa@gmail.com> wrote in message news:1150490669.083807.246850@p79g2000cwp.googlegroups.com...
> > Sue,
> >
> > Now, when I press the Button created based on the Macro, nothing
> > happens. The first time, I clicked the button and it showed the form
> > right away, I filled it, and sent it. Then I could notice Outlook
> > sending the email. Now, nothings happens at all, after I click the
> > button.
> >
> > I also tried to fill the Initial value field, but once I published the
> > form and then opened it, the address would get replaced with a date.
> >
> > I'm kind of lost right now.
> >
> > Best Regards,
> >
> > Alexandre Sousa
> >
> > Sue Mosher [MVP-Outlook] wrote:
> >> What precisely didn't work? In other words, what happened when you stepped through the code.
> >>
> >> In general when creating new items, Display should be your last statement .
> >>
> >> <alexandre.sousa@gmail.com> wrote in message news:1150486356.956797.296190@c74g2000cwc.googlegroups.com...
> >> > Hi,
> >> >
> >> > I've followed the MS KB article to Open Form from a Toolbar Button.
> >> >
> >> > This is the Macro, as I have it in ThisOutlookSession:
> >> >
> >> > Sub DisplayForm()
> >> > Set myFolder = Session.GetDefaultFolder(olFolderInbox)
> >> > Set myItem = myFolder.Items.Add("IPM.Note.SuppRequest")
> >> > myItem.Display
> >> > myItem.Recipient.Add ("mail@mail.not")
> >> > End Sub
> >> >
> >> > The only difference from the KB Article is the Recipient.Add. However,
> >> > my problem is that I got it to work just as I left my Office, and as
> >> > soon as I got home never worked again.
> >> >
> >> > Anyone got a clue?
> >> >
> >> > Best Regards,
> >> >
> >> > Alexandre Sousa
> >> >

> >


  Reply With Quote
Old 16-06-2006, 11:42 PM   #6
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Open Form from Macro

> Now I have to figure out how to program a "secure" Macro.

See http://www.outlookcode.com/d/vb.htm#selfcert

--
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

"asousa" <alexandre.sousa@gmail.com> wrote in message news:1150494115.257964.76540@h76g2000cwa.googlegroups.com...
> Sue,
>
> Your answer did help. I've got little programming background. Even more
> so with all the security restrictions nowadays. The problem was that
> Outlook had the Macro Security setting set to "High". I found this as I
> Googled thru to figure out how to Run the Macro in the VBA environment.
>
> Now I have to figure out how to program a "secure" Macro.
>
> Thanks for the help.
>
> Best Regards,
>
> Alexandre Sousa
>
> Sue Mosher [MVP-Outlook] wrote:
>> > Now, when I press the Button created based on the Macro, nothing
>> > happens.

>>
>> Repeating: What happens when you step through the macro in the VBA environment?
>>
>> > The reason why I add the recipient last, is because I want to fill the
>> > To: field, which I deleted from the form. This is a tech support
>> > request form. It's supposed to always be delivered to the same address.

>>
>> No reason why you can't do that before you display it.
>>
>> --
>> 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
>>
>> <alexandre.sousa@gmail.com> wrote in message news:1150490669.083807.246850@p79g2000cwp.googlegroups.com...
>> > Sue,
>> >
>> > Now, when I press the Button created based on the Macro, nothing
>> > happens. The first time, I clicked the button and it showed the form
>> > right away, I filled it, and sent it. Then I could notice Outlook
>> > sending the email. Now, nothings happens at all, after I click the
>> > button.
>> >
>> > I also tried to fill the Initial value field, but once I published the
>> > form and then opened it, the address would get replaced with a date.
>> >
>> > I'm kind of lost right now.
>> >
>> > Best Regards,
>> >
>> > Alexandre Sousa
>> >
>> > Sue Mosher [MVP-Outlook] wrote:
>> >> What precisely didn't work? In other words, what happened when you stepped through the code.
>> >>
>> >> In general when creating new items, Display should be your last statement .
>> >>
>> >> <alexandre.sousa@gmail.com> wrote in message news:1150486356.956797.296190@c74g2000cwc.googlegroups.com...
>> >> > Hi,
>> >> >
>> >> > I've followed the MS KB article to Open Form from a Toolbar Button.
>> >> >
>> >> > This is the Macro, as I have it in ThisOutlookSession:
>> >> >
>> >> > Sub DisplayForm()
>> >> > Set myFolder = Session.GetDefaultFolder(olFolderInbox)
>> >> > Set myItem = myFolder.Items.Add("IPM.Note.SuppRequest")
>> >> > myItem.Display
>> >> > myItem.Recipient.Add ("mail@mail.not")
>> >> > End Sub
>> >> >
>> >> > The only difference from the KB Article is the Recipient.Add. However,
>> >> > my problem is that I got it to work just as I left my Office, and as
>> >> > soon as I got home never worked again.
>> >> >
>> >> > Anyone got a clue?
>> >> >
>> >> > Best Regards,
>> >> >
>> >> > Alexandre Sousa
>> >> >
>> >

>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off