Outlook SaveAs Dialog and SharePoint

N

Nick

Is there a way to use the same dialog that appears when you select "File >
Save As" in outlook, using VBA?

I have added a button to a command bar
When selected I want the Save As Dialog to appear

I want to be able to Save a selected email to a sharepoint document libary
as a .msg file.

I tried:

Dim oMail As MailItem
Dim strName As String
Set oMail = Me.ActiveInspector.CurrentItem
strName = oMail.Subject

oMail.SaveAs "http://sharepoint/site/DocLibrary/" & strName & ".msg",
olMSG

----> but this only saves directly to the specified location.


I want to be able to be prompted with the "SaveAs" dialog and parse the top
level sharepoint site name (which will automatically list all the available
document libraries on that site with a html view)

I tried using the common dialog:

Dim dlg As Object
Set dlg = CreateObject("MSComDlg.CommonDialog")
With dlg
.InitDir = "http://sharepoint/site/"
.MaxFileSize = 500 'Sets the maximum file size allowed
.ShowSave
End With

-----> but the common dialog does not work with sharepoint, so it will only
list the "explorer" view and display all the sub directories on that site.


I looked at an example on outlookcode.com of using the word dialog, but I
don't want to have any dependencies on other applications.

If you can display the SaveAs dialog from the File menu in outlook, how come
you can't call it from VBA in Outlook?
There has to be some way to natively call this dialog from within Outlook?
 
N

Nick Porter

Thanks for the input Eric, much appreciated!

It really is quite annoying that Outlook does not support
"Application.FileDialog", it would make life a lot easier.

It looks as though depending on Word may be the better of two (or in this
case 3) evils.

Kind Regards,

- Nick Porter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top