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

Save As dialog box on screen



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 22nd 09, 12:16 AM posted to microsoft.public.outlook.program_vba
jesseb
external usenet poster
 
Posts: 1
Default Save As dialog box on screen

Need help.
My user needs to save email to a folder on the network as a PDF.
She has Acrobat, so the ability to save as PDF is there. The Save As dialog
box needs to pop up so she can pick file type.

I have some code to save the open email but the problem is I can not get the
right code to open the Save As dialog box on the screen so she can pick file
type as PDF.
Or the code that would change the File type to PDF.

Sub SaveAsPDF_OLD()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.ActiveInspector
'If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
strname = objItem.Subject
objItem.SaveAsdialog ' "C:\" & strname & ".txt", oltxt
End Sub


Any help out there?


  #2  
Old October 22nd 09, 12:39 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Save As dialog box on screen

You can't just make up your own method names, like SaveAsDialog. Look in the
object browser (F2 in VBA) to see what's available for each object. (And if
you do that with the SaveAs method, you'll see that it does not support any
constant for the 2nd argument that would allow for programmatically saving
an item as a PDF file.)

In this case, though, you won't find anything, because Outlook doesn't
expose a direct method for invoking that UI. It has to be done through the
CommandBars collection, as in this Outlook VBA procedu

Sub ShowSaveAs()
Dim insp As Outlook.Inspector
Dim cbb As Office.CommandBarButton
Set insp = Application.ActiveInspector
If Not insp Is Nothing Then
Set cbb = insp.CommandBars.FindControl(, 748)
If Not cbb Is Nothing Then
cbb.Execute
End If
End If
Set insp = Nothing
Set cbb = Nothing
End Sub

This doesn't really get you very far, unfortunately, because she still has
to pick the path and save as type. The dialog can't be manipulated
programmatically, unless you want to try to code a SendKeys kludge.

FYI, you can use the Outlook VBA code sample at
http://www.outlookcode.com/codedetail.aspx?id=1507 to get the IDs, like 748
for Save As, that you need to be able to execute toolbar and menu commands.
Or use the Outlook Spy tool from http://www.dimastr.com/outspy/.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"jesseb" wrote in message
...
Need help.
My user needs to save email to a folder on the network as a PDF.
She has Acrobat, so the ability to save as PDF is there. The Save As
dialog
box needs to pop up so she can pick file type.

I have some code to save the open email but the problem is I can not get
the
right code to open the Save As dialog box on the screen so she can pick
file
type as PDF.
Or the code that would change the File type to PDF.

Sub SaveAsPDF_OLD()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.ActiveInspector
'If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
strname = objItem.Subject
objItem.SaveAsdialog ' "C:\" & strname & ".txt", oltxt
End Sub


Any help out there?




 




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
Outlook 2003 security dialog box only works on screen 1 DerrickV Outlook and VBA 1 August 8th 08 12:52 AM
Outlook 2007 save changes dialog box GR Add-ins for Outlook 3 July 11th 07 10:52 PM
Suppress the save dialog, exceptions occur... KevinH Outlook - Using Forms 0 February 27th 07 02:54 PM
How do I get File Save As Dialog Box for Attachments? Mike M 91107 Outlook and VBA 3 June 9th 06 12:36 AM
bypassing save dialog box philippe Outlook - Using Forms 5 April 26th 06 03:52 PM


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