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

Saveas dialog



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 15th 06, 02:28 PM posted to microsoft.public.outlook.program_vba
Dimitri
external usenet poster
 
Posts: 2
Default Saveas dialog

Hello,

I'm using the code below to save an MailItem to my harddrive as a back up
and digital archive. In the code there is an folder hard coded
(C:\Data\outlook\) I would like to Have a Dialog like File Save As tot pick a
certain folder on my harddrive

Can somebody help me out with this?

Thanks!
Dimitri

Sub SaveAsFile()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim strname As String
Set myItem = Application.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
objItem.SaveAs "C:\Data\outlook\" & "Test1.msg", olMSG
Else
MsgBox "There is no current active inspector."
End If
End Sub

Ads
  #2  
Old February 15th 06, 10:56 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Saveas dialog

You'd have to use a class to instantiate a folder browser dialog. See:

VB TIP: Using the Browse Folder Dialog Box:
http://www.developer.com/net/vb/article.php/1541831

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Dimitri" wrote:

Hello,

I'm using the code below to save an MailItem to my harddrive as a back up
and digital archive. In the code there is an folder hard coded
(C:\Data\outlook\) I would like to Have a Dialog like File Save As tot pick a
certain folder on my harddrive

Can somebody help me out with this?

Thanks!
Dimitri

Sub SaveAsFile()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim strname As String
Set myItem = Application.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
objItem.SaveAs "C:\Data\outlook\" & "Test1.msg", olMSG
Else
MsgBox "There is no current active inspector."
End If
End Sub

  #3  
Old February 16th 06, 11:26 AM posted to microsoft.public.outlook.program_vba
Vaughan
external usenet poster
 
Posts: 32
Default Saveas dialog

Is there any way of doing this in vbscript?

Thanks

Vaughan

"Eric Legault [MVP - Outlook]" wrote:

You'd have to use a class to instantiate a folder browser dialog. See:

VB TIP: Using the Browse Folder Dialog Box:
http://www.developer.com/net/vb/article.php/1541831

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Dimitri" wrote:

Hello,

I'm using the code below to save an MailItem to my harddrive as a back up
and digital archive. In the code there is an folder hard coded
(C:\Data\outlook\) I would like to Have a Dialog like File Save As tot pick a
certain folder on my harddrive

Can somebody help me out with this?

Thanks!
Dimitri

Sub SaveAsFile()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim strname As String
Set myItem = Application.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
objItem.SaveAs "C:\Data\outlook\" & "Test1.msg", olMSG
Else
MsgBox "There is no current active inspector."
End If
End Sub

  #4  
Old February 18th 06, 10:00 PM posted to microsoft.public.outlook.program_vba
Dimitri
external usenet poster
 
Posts: 2
Default Saveas dialog

Eric,

Is there not a way like Word and Excel. In here I can call the SaveAs Dialog
some thing like "dialogs(dlgFileSaveAs).show" The selected folder is then put
in a variable and can be used later on.

Greetings and thanks so far
Dimitri

"Eric Legault [MVP - Outlook]" wrote:

You'd have to use a class to instantiate a folder browser dialog. See:

VB TIP: Using the Browse Folder Dialog Box:
http://www.developer.com/net/vb/article.php/1541831

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Dimitri" wrote:

Hello,

I'm using the code below to save an MailItem to my harddrive as a back up
and digital archive. In the code there is an folder hard coded
(C:\Data\outlook\) I would like to Have a Dialog like File Save As tot pick a
certain folder on my harddrive

Can somebody help me out with this?

Thanks!
Dimitri

Sub SaveAsFile()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim strname As String
Set myItem = Application.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
objItem.SaveAs "C:\Data\outlook\" & "Test1.msg", olMSG
Else
MsgBox "There is no current active inspector."
End If
End Sub

  #5  
Old February 20th 06, 06:51 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Saveas dialog

Outlook unfortunately doesn't support the same interfaces with it's
Application object like the other Office apps. You can always instantiate
Word or Excel to get access to that object, but that's probably not a good
idea.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Dimitri" wrote:

Eric,

Is there not a way like Word and Excel. In here I can call the SaveAs Dialog
some thing like "dialogs(dlgFileSaveAs).show" The selected folder is then put
in a variable and can be used later on.

Greetings and thanks so far
Dimitri

"Eric Legault [MVP - Outlook]" wrote:

You'd have to use a class to instantiate a folder browser dialog. See:

VB TIP: Using the Browse Folder Dialog Box:
http://www.developer.com/net/vb/article.php/1541831

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Dimitri" wrote:

Hello,

I'm using the code below to save an MailItem to my harddrive as a back up
and digital archive. In the code there is an folder hard coded
(C:\Data\outlook\) I would like to Have a Dialog like File Save As tot pick a
certain folder on my harddrive

Can somebody help me out with this?

Thanks!
Dimitri

Sub SaveAsFile()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim strname As String
Set myItem = Application.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
objItem.SaveAs "C:\Data\outlook\" & "Test1.msg", olMSG
Else
MsgBox "There is no current active inspector."
End If
End Sub

  #6  
Old February 20th 06, 06:51 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Saveas dialog

No, because Win32 API's cannot be declared in VBScript. However, if you used
the CommonFileDialog control in a custom Outlook form you should be able to
automate that control in code. Keep in mind that the CommonFileDialog is not
very useful for selecting a directory, as it is file specific.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Vaughan" wrote:

Is there any way of doing this in vbscript?

Thanks

Vaughan

"Eric Legault [MVP - Outlook]" wrote:

You'd have to use a class to instantiate a folder browser dialog. See:

VB TIP: Using the Browse Folder Dialog Box:
http://www.developer.com/net/vb/article.php/1541831

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Dimitri" wrote:

Hello,

I'm using the code below to save an MailItem to my harddrive as a back up
and digital archive. In the code there is an folder hard coded
(C:\Data\outlook\) I would like to Have a Dialog like File Save As tot pick a
certain folder on my harddrive

Can somebody help me out with this?

Thanks!
Dimitri

Sub SaveAsFile()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim strname As String
Set myItem = Application.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
objItem.SaveAs "C:\Data\outlook\" & "Test1.msg", olMSG
Else
MsgBox "There is no current active inspector."
End If
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
Word print dialog box Martin Outlook - Using Forms 1 January 31st 06 02:05 PM
Saveas web page shows Appointment and Event Details Robert Grimes Outlook - Calandaring 0 January 30th 06 03:09 PM
SaveAs() sometimes loses userProperty! PuppetMaster Add-ins for Outlook 3 January 24th 06 11:49 AM
SaveAs() sometimes loses userProperty! PuppetMaster Outlook and VBA 3 January 24th 06 11:49 AM
dialog comes up when trying to access mailItem Neo Add-ins for Outlook 3 January 16th 06 10:56 PM


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