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

getting the name of the pst file



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 22nd 09, 12:10 AM posted to microsoft.public.outlook.program_vba
Russ
external usenet poster
 
Posts: 23
Default getting the name of the pst file

Does anyone know the line of code line that will return the name of the pst
file currently selected. Below is part of the code that precedes where I
want to insert the line to get the pst file name

Sub ExportToExcel()

On Error GoTo ErrHandler

Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range
Dim strSheet As String
Dim strPath As String
Dim intRowCounter As Integer
Dim intColumnCounter As Integer
Dim msg As Outlook.MailItem
Dim nms As Outlook.NameSpace
Dim fname As Outlook.NameSpace
Dim fld As Outlook.MAPIFolder
Dim itm As Object

strSheet = "email recovery.xlsx"
strPath = "D:\Mod 50 project\pst files Mod 50 project\"
strSheet = strPath & strSheet
'Debug.Print strSheet

'Select export folder
Set nms = Application.GetNamespace("MAPI")
Set fld = nms.PickFolder
'I want to insert the line here'
'more code follows to put the fields in the email messages in the folder
'fld' into an Excel spreadsheet
--
russ
  #2  
Old October 22nd 09, 12:29 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default getting the name of the pst file

In Outlook 2007, use the Folder.Store.FilePath property. In earlier
versions, you can hack it from the StoreID; see
http://www.outlookcode.com/codedetail.aspx?id=1434
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Russ" wrote in message
...
Does anyone know the line of code line that will return the name of the
pst
file currently selected. Below is part of the code that precedes where I
want to insert the line to get the pst file name

Sub ExportToExcel()

On Error GoTo ErrHandler

Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range
Dim strSheet As String
Dim strPath As String
Dim intRowCounter As Integer
Dim intColumnCounter As Integer
Dim msg As Outlook.MailItem
Dim nms As Outlook.NameSpace
Dim fname As Outlook.NameSpace
Dim fld As Outlook.MAPIFolder
Dim itm As Object

strSheet = "email recovery.xlsx"
strPath = "D:\Mod 50 project\pst files Mod 50 project\"
strSheet = strPath & strSheet
'Debug.Print strSheet

'Select export folder
Set nms = Application.GetNamespace("MAPI")
Set fld = nms.PickFolder
'I want to insert the line here'
'more code follows to put the fields in the email messages in the folder
'fld' into an Excel spreadsheet
--
russ



  #3  
Old October 22nd 09, 04:07 PM posted to microsoft.public.outlook.program_vba
Russ
external usenet poster
 
Posts: 23
Default getting the name of the pst file

Sue,
Thanks works perfectly. It is a bit more than the one line I thought it
would be. God knows how long it would have taken me on my own.
Again, many thanks.
--
russ


"Sue Mosher [MVP]" wrote:

In Outlook 2007, use the Folder.Store.FilePath property. In earlier
versions, you can hack it from the StoreID; see
http://www.outlookcode.com/codedetail.aspx?id=1434
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Russ" wrote in message
...
Does anyone know the line of code line that will return the name of the
pst
file currently selected. Below is part of the code that precedes where I
want to insert the line to get the pst file name

Sub ExportToExcel()

On Error GoTo ErrHandler

Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range
Dim strSheet As String
Dim strPath As String
Dim intRowCounter As Integer
Dim intColumnCounter As Integer
Dim msg As Outlook.MailItem
Dim nms As Outlook.NameSpace
Dim fname As Outlook.NameSpace
Dim fld As Outlook.MAPIFolder
Dim itm As Object

strSheet = "email recovery.xlsx"
strPath = "D:\Mod 50 project\pst files Mod 50 project\"
strSheet = strPath & strSheet
'Debug.Print strSheet

'Select export folder
Set nms = Application.GetNamespace("MAPI")
Set fld = nms.PickFolder
'I want to insert the line here'
'more code follows to put the fields in the email messages in the folder
'fld' into an Excel spreadsheet
--
russ



.

 




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
trying to export .aba file from Palm Desktop to .csv file and havingproblems with irregular characters Joe Outlook - General Queries 1 May 4th 08 05:18 PM
Outlook 2002 SP3: Can't open file: *.msg. The file may not exist, youmay... [email protected] Outlook - General Queries 6 February 7th 08 03:02 PM
PRF file problem wiht personal folders data file password protecte Groupex1 Outlook - Installation 0 November 1st 07 09:01 PM
Outlook file translators stuck on a default data file or not worki Charles griffiths Outlook - Using Contacts 2 April 23rd 07 12:50 PM
excel file type missing from import a file window in outlook xanadufl Outlook - Using Contacts 9 February 28th 06 10:55 AM


All times are GMT +1. The time now is 07:04 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.