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

GetPublicFolder() function



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old April 18th 06, 04:46 AM posted to microsoft.public.outlook.program_vba
Morgan
external usenet poster
 
Posts: 1
Default GetPublicFolder() function

ok I'm very new to programing in Outlook. I have a custom form with 3
command buttons on it and I want to use the GetPublicFolder() function but
not sure how to call the function for each button or if it needs to be
inside the Sub for each button see code below




Public Function GetPublicFolder()

Dim colFolders
Dim objFolder
Dim arrFolders
Dim i
On Error Resume Next
strFolderPath = Replace(strFolderPath, "/", "\")
arrFolders = Split(strFolderPath, "\")

Set objFolder = Application.Session.GetDefaultFolder(18)
Set objFolder = objFolder.Folders.Item(arrFolders(0))
If Not objFolder Is Nothing Then
For i = 1 To UBound(arrFolders)
Set colFolders = objFolder.Folders
Set objFolder = Nothing
Set objFolder = colFolders.Item(arrFolders(i))
If objFolder Is Nothing Then
Exit For
End If
Next
End If
Set GetPublicFolder = objFolder
Set colFolders = Nothing
Set objApp = Nothing
Set objFolder = Nothing
End Function


'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZ
'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZ
'ZZ need to call public function GetPublicFolder() ZZZ
'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZ
'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZ

'Action and call for Create Contact History
Sub creathist_Click()
'need to assign projourn as default form
GetPublicFolder(Public Folders\All Public Folders\Construction\Project
Jornals\)
MsgBox "This will open Project Journals"
End Sub

'Action and call for Create Task
Sub CommandButton4_Click()
'need to assign protask as default form
GetPublicFolder(Public Folders\All Public
Folders\Construction\construction\Project Task\)
MsgBox "This will open Project Task"
End Sub

'Action and call for Create Appt
Sub CommandButton3_Click()
'need to assign proappt as default form
GetPublicFolder(Public Folders\All Public
Folders\Construction\construction\Project Appointmenst and Dates\)
MsgBox "This will open Project Appointmenst and Dates"
End Sub


 




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
Scheduling without email function Valarie Outlook - General Queries 1 April 12th 06 05:10 AM
Outlook 2003 Import Function pwoodbba Outlook - Using Contacts 1 April 7th 06 11:22 AM
Search Function has changed LAH Outlook Express 4 March 10th 06 01:42 PM
Autocomplete function works only once Kyle Roberts Outlook - General Queries 3 February 21st 06 05:00 AM
Spare time function magoo Outlook - Calandaring 0 February 2nd 06 07:11 PM


All times are GMT +1. The time now is 08:32 PM.


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.