Help!

VBScript doesn't work

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Program Forms RSS
Next:  multilevel list using greek  
Author Message
Stefan
External


Since: Jan 24, 2005
Posts: 36



PostPosted: Mon Mar 09, 2009 7:04 am    Post subject: VBScript doesn't work
Archived from groups: microsoft>public>outlook>program_forms (more info?)

Hi all!

I am very new in designing Outlook Forms. However I designed my first form
including a CommandButton which should paste a text into a TextBox (I
programmed this function in the VBScript Editor). If I am working in the
Developer Mode and click on "Run This Form", the function works properly.
However if I open the form and directly click on the CommandButton (without
entering the Developer Mode and clicking Run This Form") or if I send the
Form, it doesn`t work anymore.
This is the Code I use:

Sub CommandButton2_Click()
Dim RequestID
Dim Tower
Dim Subject
Dim Datum

'get control items
Set RequestID = Item.GetInspector.ModifiedFormPages.Item("Request for
Change").Controls("RequestID")
Set Tower = Item.GetInspector.ModifiedFormPages.Item("Request for
Change").Controls("Tower")
Set Subject = Item.GetInspector.ModifiedFormPages.Item("Request for
Change").Controls("Subject")
Set Datum = Item.GetInspector.ModifiedFormPages.Item("Request for
Change").Controls("Datum")

RequestID.Value = "DE1-HBM02-IMS-" & Year(Date) & Month(Date) & Day(Date) &
Hour(Time) & Minute(Time)
Subject.Value = "Request for Change " & RequestID.Value & " " & "<" &
Tower.Value & ">"
Datum.Value = Day(Date) & "." & Month(Date) & "." & Year(Date)
End Sub

How can I make the CommandButton work ALWAYS????
Back to top
Sue Mosher [MVP-Outlook]
External


Since: Mar 09, 2009
Posts: 4



PostPosted: Mon Mar 09, 2009 8:56 am    Post subject: RE: VBScript doesn't work [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Did you publish the form to your Personal Forms library? Code runs only on
published forms.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54




"Stefan" wrote:

> Hi all!
>
> I am very new in designing Outlook Forms. However I designed my first form
> including a CommandButton which should paste a text into a TextBox (I
> programmed this function in the VBScript Editor). If I am working in the
> Developer Mode and click on "Run This Form", the function works properly.
> However if I open the form and directly click on the CommandButton (without
> entering the Developer Mode and clicking Run This Form") or if I send the
> Form, it doesn`t work anymore.
> This is the Code I use:
>
> Sub CommandButton2_Click()
> Dim RequestID
> Dim Tower
> Dim Subject
> Dim Datum
>
> 'get control items
> Set RequestID = Item.GetInspector.ModifiedFormPages.Item("Request for
> Change").Controls("RequestID")
> Set Tower = Item.GetInspector.ModifiedFormPages.Item("Request for
> Change").Controls("Tower")
> Set Subject = Item.GetInspector.ModifiedFormPages.Item("Request for
> Change").Controls("Subject")
> Set Datum = Item.GetInspector.ModifiedFormPages.Item("Request for
> Change").Controls("Datum")
>
> RequestID.Value = "DE1-HBM02-IMS-" & Year(Date) & Month(Date) & Day(Date) &
> Hour(Time) & Minute(Time)
> Subject.Value = "Request for Change " & RequestID.Value & " " & "<" &
> Tower.Value & ">"
> Datum.Value = Day(Date) & "." & Month(Date) & "." & Year(Date)
> End Sub
>
> How can I make the CommandButton work ALWAYS????
Back to top
nyturn



Joined: Sep 02, 2009
Posts: 1



PostPosted: Wed Sep 02, 2009 8:13 am    Post subject: [Login to view extended thread Info.]

I use ExeScript Pro VBScript editor and your example works fine with it.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Program Forms All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum