A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Location of Published Forms



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 18th 07, 12:57 PM posted to microsoft.public.outlook.program_vba
LDMueller
external usenet poster
 
Posts: 53
Default Location of Published Forms

With Outlook 2003 I have two published forms. My goal is to have a command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other published
form. Can someone point me in the right direction?

Thanks so much!
Ads
  #2  
Old June 18th 07, 02:23 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Location of Published Forms

If it's already published just open it using the custom MessageClass.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"LDMueller" wrote in message
...
With Outlook 2003 I have two published forms. My goal is to have a
command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other
published
form. Can someone point me in the right direction?

Thanks so much!


  #3  
Old June 18th 07, 04:27 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Location of Published Forms

You don't need a path for the form. To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

Note that code on Outlook custom forms is VBScript, not VBA.

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


"LDMueller" wrote in message ...
With Outlook 2003 I have two published forms. My goal is to have a command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other published
form. Can someone point me in the right direction?

Thanks so much!

  #4  
Old June 18th 07, 06:49 PM posted to microsoft.public.outlook.program_vba
LDMueller
external usenet poster
 
Posts: 53
Default Location of Published Forms

I tried to figure out how to do this by looking up MessageClass, but all
variations of the code I wrote didn't work.

The form I open which has the command button is a Message Form and the
command button points to an Appointment form whose Message class is
"IPM.Appointment.IS Schedule Notification".

I just can't seem to format the code.

"Ken Slovak - [MVP - Outlook]" wrote:

If it's already published just open it using the custom MessageClass.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"LDMueller" wrote in message
...
With Outlook 2003 I have two published forms. My goal is to have a
command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other
published
form. Can someone point me in the right direction?

Thanks so much!



  #5  
Old June 18th 07, 06:55 PM posted to microsoft.public.outlook.program_vba
LDMueller
external usenet poster
 
Posts: 53
Default Location of Published Forms

Hi Sue,

The form in question is an Appoinment form with a Message class of
"IPM.Appointment.IS Schedule Notification".

My original code is below and worked beautifully in Form Design when running
Forms, Run This Form. Once the form is published, it doesn't work because
I'm pointing to an .OFT file and not the Message class.

Sub CommandButton4_Click()

Set myItem = Application.CreateItemFromTemplate _
("C:\Documents and Settings\ldm\Application Data\Microsoft\Templates\IS
Schedule Notification.oft")

myItem.Display

dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate)
tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime)
myItem.Start = CDate(dte & " " & tme)

myItem.Send

End Sub



"Sue Mosher [MVP-Outlook]" wrote:

You don't need a path for the form. To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

Note that code on Outlook custom forms is VBScript, not VBA.

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


"LDMueller" wrote in message ...
With Outlook 2003 I have two published forms. My goal is to have a command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other published
form. Can someone point me in the right direction?

Thanks so much!


  #6  
Old June 18th 07, 07:25 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Location of Published Forms

Did you try the Items.Add method that I suggested?

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


"LDMueller" wrote in message ...
Hi Sue,

The form in question is an Appoinment form with a Message class of
"IPM.Appointment.IS Schedule Notification".

My original code is below and worked beautifully in Form Design when running
Forms, Run This Form. Once the form is published, it doesn't work because
I'm pointing to an .OFT file and not the Message class.

Sub CommandButton4_Click()

Set myItem = Application.CreateItemFromTemplate _
("C:\Documents and Settings\ldm\Application Data\Microsoft\Templates\IS
Schedule Notification.oft")

myItem.Display

dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate)
tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime)
myItem.Start = CDate(dte & " " & tme)

myItem.Send

End Sub



"Sue Mosher [MVP-Outlook]" wrote:

You don't need a path for the form. To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

Note that code on Outlook custom forms is VBScript, not VBA.


"LDMueller" wrote in message ...
With Outlook 2003 I have two published forms. My goal is to have a command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other published
form. Can someone point me in the right direction?

Thanks so much!


  #7  
Old June 18th 07, 07:38 PM posted to microsoft.public.outlook.program_vba
LDMueller
external usenet poster
 
Posts: 53
Default Location of Published Forms

Yes, but since I'm limited to what I know, I couldn't figure out the
"targetFolder" part because when the form "IS Schedule Notification" opens,
the To: is completed with four different users.

This is what I tried to use, but the TargetFolder part wasn't working.
Set newItem = targetFolder.Items.Add("IPM.Appointment.IS Schedule
Notification")


"Sue Mosher [MVP-Outlook]" wrote:

Did you try the Items.Add method that I suggested?

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


"LDMueller" wrote in message ...
Hi Sue,

The form in question is an Appoinment form with a Message class of
"IPM.Appointment.IS Schedule Notification".

My original code is below and worked beautifully in Form Design when running
Forms, Run This Form. Once the form is published, it doesn't work because
I'm pointing to an .OFT file and not the Message class.

Sub CommandButton4_Click()

Set myItem = Application.CreateItemFromTemplate _
("C:\Documents and Settings\ldm\Application Data\Microsoft\Templates\IS
Schedule Notification.oft")

myItem.Display

dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate)
tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime)
myItem.Start = CDate(dte & " " & tme)

myItem.Send

End Sub



"Sue Mosher [MVP-Outlook]" wrote:

You don't need a path for the form. To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

Note that code on Outlook custom forms is VBScript, not VBA.


"LDMueller" wrote in message ...
With Outlook 2003 I have two published forms. My goal is to have a command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other published
form. Can someone point me in the right direction?

Thanks so much!


  #8  
Old June 18th 07, 07:44 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Location of Published Forms

You might want to reread the 2nd part of my response, which explained which method to use to return an appropriate target 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


"LDMueller" wrote in message ...
Yes, but since I'm limited to what I know, I couldn't figure out the
"targetFolder" part because when the form "IS Schedule Notification" opens,
the To: is completed with four different users.

This is what I tried to use, but the TargetFolder part wasn't working.
Set newItem = targetFolder.Items.Add("IPM.Appointment.IS Schedule
Notification")


"Sue Mosher [MVP-Outlook]" wrote:

Did you try the Items.Add method that I suggested?




"LDMueller" wrote in message ...
Hi Sue,

The form in question is an Appoinment form with a Message class of
"IPM.Appointment.IS Schedule Notification".

My original code is below and worked beautifully in Form Design when running
Forms, Run This Form. Once the form is published, it doesn't work because
I'm pointing to an .OFT file and not the Message class.

Sub CommandButton4_Click()

Set myItem = Application.CreateItemFromTemplate _
("C:\Documents and Settings\ldm\Application Data\Microsoft\Templates\IS
Schedule Notification.oft")

myItem.Display

dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate)
tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime)
myItem.Start = CDate(dte & " " & tme)

myItem.Send

End Sub



"Sue Mosher [MVP-Outlook]" wrote:

You don't need a path for the form. To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

Note that code on Outlook custom forms is VBScript, not VBA.


"LDMueller" wrote in message ...
With Outlook 2003 I have two published forms. My goal is to have a command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other published
form. Can someone point me in the right direction?

Thanks so much!


  #9  
Old June 19th 07, 03:05 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Location of Published Forms

Look at Sue's response.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"LDMueller" wrote in message
...
I tried to figure out how to do this by looking up MessageClass, but all
variations of the code I wrote didn't work.

The form I open which has the command button is a Message Form and the
command button points to an Appointment form whose Message class is
"IPM.Appointment.IS Schedule Notification".


  #10  
Old June 19th 07, 06:12 PM posted to microsoft.public.outlook.program_vba
LDMueller
external usenet poster
 
Posts: 53
Default Location of Published Forms

Hi Sue,

I did read the 2nd part of your reponse, but I just couldn't figure it out.
So, what I did was write code to create a completed appointment as follows:

Sub CommandButton4_Click()

Const FormName = "IPM.Appointment"

Dim oItem
dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"),
vbShortDate)
tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"),
vbShortTime)

Set oItem = Application.ActiveExplorer.CurrentFolder.Items.Add (FormName)
oItem.Display

strSubject = "Setup Equipment"

Set myRecipient = oItem.Recipients.Add ("LDM")
oItem.Subject = strSubject
oItem.AllDayEvent = True
oItem.ReminderSet = True
oItem.ReminderMinutesBeforeStart = 180
oItem.Start = CDate(dte & " " & tme)

oItem.Send

End Sub

This works perfectly with one exception. What is the code for "Show time as
= Free".

Thanks,
LDMueller



"Sue Mosher [MVP-Outlook]" wrote:

You might want to reread the 2nd part of my response, which explained which method to use to return an appropriate target 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


"LDMueller" wrote in message ...
Yes, but since I'm limited to what I know, I couldn't figure out the
"targetFolder" part because when the form "IS Schedule Notification" opens,
the To: is completed with four different users.

This is what I tried to use, but the TargetFolder part wasn't working.
Set newItem = targetFolder.Items.Add("IPM.Appointment.IS Schedule
Notification")


"Sue Mosher [MVP-Outlook]" wrote:

Did you try the Items.Add method that I suggested?




"LDMueller" wrote in message ...
Hi Sue,

The form in question is an Appoinment form with a Message class of
"IPM.Appointment.IS Schedule Notification".

My original code is below and worked beautifully in Form Design when running
Forms, Run This Form. Once the form is published, it doesn't work because
I'm pointing to an .OFT file and not the Message class.

Sub CommandButton4_Click()

Set myItem = Application.CreateItemFromTemplate _
("C:\Documents and Settings\ldm\Application Data\Microsoft\Templates\IS
Schedule Notification.oft")

myItem.Display

dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate)
tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime)
myItem.Start = CDate(dte & " " & tme)

myItem.Send

End Sub



"Sue Mosher [MVP-Outlook]" wrote:

You don't need a path for the form. To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

Note that code on Outlook custom forms is VBScript, not VBA.


"LDMueller" wrote in message ...
With Outlook 2003 I have two published forms. My goal is to have a command
button on one form which uses VBA code to open the other published form.

My problem is I don't know what path to use to point to the other published
form. Can someone point me in the right direction?

Thanks so much!



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ability to read a published forms version from another form [email protected] Outlook - Using Forms 5 January 26th 07 07:10 PM
Published Forms Snake_Plisken Outlook - Using Forms 0 October 25th 06 05:59 PM
How to link published forms in public folders? winternan Outlook - Using Forms 1 October 1st 06 07:22 PM
problems with published forms Martin Outlook - Using Forms 1 April 11th 06 02:19 PM
error trying to update published form in Orgizational Forms Librar Andrew Vital Outlook - Using Forms 2 January 27th 06 06:21 PM


All times are GMT +1. The time now is 05:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.