Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - Using Forms (http://www.outlookbanter.com/outlook-using-forms/)
-   -   Get Public Folder Name - Automate PickFolder function (http://www.outlookbanter.com/outlook-using-forms/34548-get-public-folder-name-automate.html)

FondaUK December 5th 06 11:23 AM

Get Public Folder Name - Automate PickFolder function
 
Hi all,

I have an outlook custom form I have published to a Public Folder. A
new form is created from clicking a button within an MS Access database
and fields from the database are added to the custom form before
sending it.

The problem I have is referencing the public folder.

I can get the form to display with the correct data when referencing
the public folder using the code below.

Dim objOutlookApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem

Set objOutlookApp = New Outlook.Application
Set objNS = objOutlookApp.GetNamespace("MAPI")
'Set objFolder = objNS.GetDefaultFolder(olFolderDrafts)
Set objFolder = objNS.PickFolder
Set objItem = objFolder.Items.Add(g_strOutlookFormClass)

What I need is how to automatically reference the folder named

\\Public Folders\All Public Folders\Forms\Resource Forms

and create a new form based on the custom form with the data pulled in from
the database

Using the GetFolder function at
http://www.outlookcode.com/d/code/getfolder.htm

returns an error or empty string.

Cheers

Graham

Sue Mosher [MVP-Outlook] December 5th 06 01:29 PM

Get Public Folder Name - Automate PickFolder function
 
Show how you're calling GetFolder.

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

"FondaUK" wrote in message ...
Hi all,

I have an outlook custom form I have published to a Public Folder. A
new form is created from clicking a button within an MS Access database
and fields from the database are added to the custom form before
sending it.

The problem I have is referencing the public folder.

I can get the form to display with the correct data when referencing
the public folder using the code below.

Dim objOutlookApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem

Set objOutlookApp = New Outlook.Application
Set objNS = objOutlookApp.GetNamespace("MAPI")
'Set objFolder = objNS.GetDefaultFolder(olFolderDrafts)
Set objFolder = objNS.PickFolder
Set objItem = objFolder.Items.Add(g_strOutlookFormClass)

What I need is how to automatically reference the folder named

\\Public Folders\All Public Folders\Forms\Resource Forms

and create a new form based on the custom form with the data pulled in from
the database

Using the GetFolder function at
http://www.outlookcode.com/d/code/getfolder.htm

returns an error or empty string.

Cheers

Graham


FondaUK December 7th 06 02:58 PM

Get Public Folder Name - Automate PickFolder function
 
OK, so I have got it to work from MS Access using line below

Set objFolder =
objNS.GetDefaultFolder(olPublicFoldersAllPublicFol ders).Folders("Forms").Folders("Resource Forms")


Now, when the form is sent, all is ok. When the reply button is clicked,
just a blank email is shown. How do i do the above line in VBScript?




"Sue Mosher [MVP-Outlook]" wrote:

Show how you're calling GetFolder.

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

"FondaUK" wrote in message ...
Hi all,

I have an outlook custom form I have published to a Public Folder. A
new form is created from clicking a button within an MS Access database
and fields from the database are added to the custom form before
sending it.

The problem I have is referencing the public folder.

I can get the form to display with the correct data when referencing
the public folder using the code below.

Dim objOutlookApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem

Set objOutlookApp = New Outlook.Application
Set objNS = objOutlookApp.GetNamespace("MAPI")
'Set objFolder = objNS.GetDefaultFolder(olFolderDrafts)
Set objFolder = objNS.PickFolder
Set objItem = objFolder.Items.Add(g_strOutlookFormClass)

What I need is how to automatically reference the folder named

\\Public Folders\All Public Folders\Forms\Resource Forms

and create a new form based on the custom form with the data pulled in from
the database

Using the GetFolder function at
http://www.outlookcode.com/d/code/getfolder.htm

returns an error or empty string.

Cheers

Graham



Sue Mosher [MVP-Outlook] December 7th 06 03:19 PM

Get Public Folder Name - Automate PickFolder function
 
Add a Const statement to assign a value to olPublicFoldersAllPublicFolders. VBScript knows nothing about Outlook constants.

What does the Reply button have to do with this scenario? A reply will show the form designated for the Reply action on the (Actions) page of a custom form. That cannot be a form published to a public folder.

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

"FondaUK" wrote in message ...
OK, so I have got it to work from MS Access using line below

Set objFolder =
objNS.GetDefaultFolder(olPublicFoldersAllPublicFol ders).Folders("Forms").Folders("Resource Forms")


Now, when the form is sent, all is ok. When the reply button is clicked,
just a blank email is shown. How do i do the above line in VBScript?

"Sue Mosher [MVP-Outlook]" wrote:

Show how you're calling GetFolder.

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

"FondaUK" wrote in message ...
Hi all,

I have an outlook custom form I have published to a Public Folder. A
new form is created from clicking a button within an MS Access database
and fields from the database are added to the custom form before
sending it.

The problem I have is referencing the public folder.

I can get the form to display with the correct data when referencing
the public folder using the code below.

Dim objOutlookApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem

Set objOutlookApp = New Outlook.Application
Set objNS = objOutlookApp.GetNamespace("MAPI")
'Set objFolder = objNS.GetDefaultFolder(olFolderDrafts)
Set objFolder = objNS.PickFolder
Set objItem = objFolder.Items.Add(g_strOutlookFormClass)

What I need is how to automatically reference the folder named

\\Public Folders\All Public Folders\Forms\Resource Forms

and create a new form based on the custom form with the data pulled in from
the database

Using the GetFolder function at
http://www.outlookcode.com/d/code/getfolder.htm

returns an error or empty string.

Cheers

Graham



FondaUK December 7th 06 03:39 PM

Get Public Folder Name - Automate PickFolder function
 
The situation is that the form is created using data from a datbase. This is
sent to a particular person where they either approve or reject the data
shown. If the data is rejected, a certain set of questions is shown in the
custom form (previously hidden)asking for the reasons for rejection. Once
required fields have been completed, the form is then returned to the sender
and the database is automatically updated when the form reply is opened.

"Sue Mosher [MVP-Outlook]" wrote:

Add a Const statement to assign a value to olPublicFoldersAllPublicFolders. VBScript knows nothing about Outlook constants.

What does the Reply button have to do with this scenario? A reply will show the form designated for the Reply action on the (Actions) page of a custom form. That cannot be a form published to a public folder.

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

"FondaUK" wrote in message ...
OK, so I have got it to work from MS Access using line below

Set objFolder =
objNS.GetDefaultFolder(olPublicFoldersAllPublicFol ders).Folders("Forms").Folders("Resource Forms")


Now, when the form is sent, all is ok. When the reply button is clicked,
just a blank email is shown. How do i do the above line in VBScript?

"Sue Mosher [MVP-Outlook]" wrote:

Show how you're calling GetFolder.

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

"FondaUK" wrote in message ...
Hi all,

I have an outlook custom form I have published to a Public Folder. A
new form is created from clicking a button within an MS Access database
and fields from the database are added to the custom form before
sending it.

The problem I have is referencing the public folder.

I can get the form to display with the correct data when referencing
the public folder using the code below.

Dim objOutlookApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem

Set objOutlookApp = New Outlook.Application
Set objNS = objOutlookApp.GetNamespace("MAPI")
'Set objFolder = objNS.GetDefaultFolder(olFolderDrafts)
Set objFolder = objNS.PickFolder
Set objItem = objFolder.Items.Add(g_strOutlookFormClass)

What I need is how to automatically reference the folder named

\\Public Folders\All Public Folders\Forms\Resource Forms

and create a new form based on the custom form with the data pulled in from
the database

Using the GetFolder function at
http://www.outlookcode.com/d/code/getfolder.htm

returns an error or empty string.

Cheers

Graham



Sue Mosher [MVP-Outlook] December 7th 06 04:30 PM

Get Public Folder Name - Automate PickFolder function
 
Again, if you want to show a custom form when the user clicks Reply, that form has to be published in the Organizational Forms library or in each user's Personal Forms library. Outlook doesn't know to go look for it in one among possibly thousands of public folders. Even the original form won't work unless it's in Org Forms or Personal Forms. The recipient won't be able to use the form design.

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

"FondaUK" wrote in message ...
The situation is that the form is created using data from a datbase. This is
sent to a particular person where they either approve or reject the data
shown. If the data is rejected, a certain set of questions is shown in the
custom form (previously hidden)asking for the reasons for rejection. Once
required fields have been completed, the form is then returned to the sender
and the database is automatically updated when the form reply is opened.

"Sue Mosher [MVP-Outlook]" wrote:

Add a Const statement to assign a value to olPublicFoldersAllPublicFolders. VBScript knows nothing about Outlook constants.

What does the Reply button have to do with this scenario? A reply will show the form designated for the Reply action on the (Actions) page of a custom form. That cannot be a form published to a public folder.

"FondaUK" wrote in message ...
OK, so I have got it to work from MS Access using line below

Set objFolder =
objNS.GetDefaultFolder(olPublicFoldersAllPublicFol ders).Folders("Forms").Folders("Resource Forms")


Now, when the form is sent, all is ok. When the reply button is clicked,
just a blank email is shown. How do i do the above line in VBScript?

"Sue Mosher [MVP-Outlook]" wrote:

Show how you're calling GetFolder.



"FondaUK" wrote in message ...
Hi all,

I have an outlook custom form I have published to a Public Folder. A
new form is created from clicking a button within an MS Access database
and fields from the database are added to the custom form before
sending it.

The problem I have is referencing the public folder.

I can get the form to display with the correct data when referencing
the public folder using the code below.

Dim objOutlookApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem

Set objOutlookApp = New Outlook.Application
Set objNS = objOutlookApp.GetNamespace("MAPI")
'Set objFolder = objNS.GetDefaultFolder(olFolderDrafts)
Set objFolder = objNS.PickFolder
Set objItem = objFolder.Items.Add(g_strOutlookFormClass)

What I need is how to automatically reference the folder named

\\Public Folders\All Public Folders\Forms\Resource Forms

and create a new form based on the custom form with the data pulled in from
the database

Using the GetFolder function at
http://www.outlookcode.com/d/code/getfolder.htm

returns an error or empty string.

Cheers

Graham




All times are GMT +1. The time now is 05:27 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-2006 OutlookBanter.com