MailItem.SaveAs doesn't save attachments?

When I drag over an outlook message to a folder on my computer, it will save the email "*.msg" file and embedded in the email are the attachments. 
Why doesn't the MailItem.SaveAs() method do the same thing? Is there something different I need to do to embed the attachments just as if I were dragging the email over as a MSG file?
I appreciate the help in advanced.
neech
neech

Hello neech,
You need to iterate over all
Attachments and use the
SaveAsFile method which saves the attachment to the specified path.
Sub SaveAttachment()
Dim myInspector As Outlook.Inspector
Dim myItem As Outlook.MailItem
Dim myAttachments As Outlook.Attachments
Set myInspector = Application.ActiveInspector
If Not TypeName(myInspector) = "Nothing" Then
If TypeName(myInspector.CurrentItem) = "MailItem" Then
Set myItem = myInspector.CurrentItem
Set myAttachments = myItem.Attachments
'Prompt the user for confirmation
Dim strPrompt As String
strPrompt = "Are you sure you want to save the first attachment in the current item to the Documents folder? If a file with the same name already exists in the destination folder, it will be overwritten with this copy of the file."
If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbYes Then
myAttachments.Item(1).SaveAsFile Environ("HOMEPATH") & "\My Documents\" & _
myAttachments.Item(1).DisplayName
End If
Else
MsgBox "The item is of the wrong type."
End If
End If
End Sub

Similar Messages

  • PDDoc.Save doesn't save on 1st (and sometimes 2nd, 3rd, 4th etc...) try, but saves eventually

    Basically, I have a List of files to import to my C# program from a directory.
    The C# program opens the files in Acrobat X, runs a plugin on them, and once the plug in has completed, it saves the files to another location.
    AcroAppClass mApp = new AcroAppClass();
    AcroAVDocClass avDoc = new AcroAVDocClass();
    AcroPDDoc pdDoc = new AcroPDDoc();
    if (avDoc.Open(fileToOpen, ""))
        pdDoc = (AcroPDDoc)avDoc.GetPDDoc();
        mApp.MenuItemExeute("My plugin name");
        bool saved = false;
        while(!saved)
            pdDoc.Save((short)(PDSaveFlags.PDSaveFull | PDSaveFlags.PDSaveCopy | PDSaveFlags.PDSaveLinearized | PDSaveFlags.PDSaveCollectGarbage), saveFileName);
            if(File.Exists(saveFileName)
               saved = true;
           else
               Console.WriteLine("Save failed");
    The while(!saved) loop runs anywhere from 1 to x times. x has been has high as 10 times, or as low as 2, but never 1.
    Why may this be?
    I have full Administrative access to the drive, the files and the folders. The INTERESTING point is that eventually, after executing the PDDoc.Save command multiple times,
    the file does end up saving, but this can't be correct operation, right?

    BarlaeDC, the plugin edits the annotations in the document to update the links to URI annotations instead of standard Launch annotations.
    Is there a way to get a report back from my plugin to my calling application so that it knows when the plugin is completed doing its job?
    Bernd, application requirements by the client do not permit saving through the plugin. They want the C# code called through even another program, and need the C# to report back to it about the save.

  • Mail message "Save as..." doesn't save attachments when "include attachments" is ticked

    Mail message "Save As..." doesn't save attachments when "Include Attachments" is ticked for "Rich Text Format"
    Messages are supposed to be saved as rtfx files (actually folders that include the attchments in seperate files)
    It worked fine in 10.6
    How do I submit a bug report?  I have sent several request through the "Provide Mail Feedback" link since 10.7 - no joy.
    Thanks

    You can use your Apple ID to register with this site and go the Apple BugReporter. Supposedly you will get an answer if you submit feedback.
    Feedback via Apple Developer

  • HT4059 When I have a PDF that I want to open and save into iBooks - it will attempt to open it and the shelf flips around to make room for it. But it doesn't save it. I have to end up opening it in Adobe or Kindle app to view & save it.

    When I have a PDF that I want to open and save into iBooks - it will attempt to open it and the shelf flips around to make room for it. But it doesn't save it. I have to end up opening it in Adobe or Kindle app to view & save it. This has been doing this awhile, what's wrong. Should
    I take it and have it looked at?

    is there any important stuff saved to your emails? if so you could log on to your emails from a seperate device and back them up. im not sure what else you could do :/

  • When i upgrade my Mac Pro to yosemite safari doesn't good work and doesn't save bookmark plz help me to fix it

    when i upgrade my Mac Pro to yosemite safari doesn't good work and doesn't save bookmark plz help me to fix it

    hi
    when i save a page as boomark shown at the bookmark list when i close safari and restart safari evry bookmark that i saved dosn't show at the bookmark list
    excuse me for whriting i speak a little english
    1 save bookmark and show at the bookmarklist
    2 i close safari
    3 and reopen it
    4any bookmark ,i saved them dosn't show at the bookmark list

  • I recently upgraded from 4S to 5S. There are 2 games that I wish to transfer to the new device. 1st game isn't available in the Store anymore, so can't download. 2nd game doesn't save when you change devices. How do I get those 2 apps to my new phone? Tnx

    I recently upgraded from 4S to 5S. There are 2 games that I wish to transfer to the new device. 1st game isn't available in the Store anymore, so can't download. 2nd game doesn't save when you change devices. How do I get those 2 apps to my new phone? Can I do that manually through iTunes?
    Thanks!

    Hello jon713,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    iTunes: About iOS backups
    http://support.apple.com/kb/ht4946
    App Store Application data (except the Application itself, its tmp, and Caches folder)
    Application settings, preferences, and data, including documents
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/ht1848
    To transfer iTunes Store purchases from your device to a computer, follow these steps:
    Connect your device to the computer. If it is synced with another iTunes library, the following dialog may appear:
    Click the Transfer Purchases button.
    Have a nice day,
    Mario

  • When trying to PDF a webpage into a PDF, it does not work, I go through all the steps as normal, and It does nothing. I can repeat my action, where instead of "printing" to adobe, it saves the file, which it doesn't save it at all. I can't even find the o

    When trying to PDF a webpage into a PDF, it does not work, I go through all the steps as normal, and It does nothing. I can repeat my action, where instead of "printing" to adobe, it saves the file, which it doesn't save it at all. I can't even find the original in my work folder. I need to know how to stop this from happeing and get it back to the way it has been working he last 6 months since i purchased this program.

    Hi pissedadobeuser,
    Does this issue occur with any particular web page?
    Are you able to print the webpage to 'Adobe PDF' to convert it to pdf.
    Which Browser version, OS version and Acrobat version are you using?
    Regards,
    Rave

  • Edited photo doesn't save to PC (iOS 8)

    (iOS 8, iPhone 6) When I use the iPhone Photos app to edit a photo to, for example, remove red-eye and/or use the magic wand tool, then click "Done," it says it saves. I can go back into edit mode with that photo later and it always gives me the option to "Revert" to the original, so it obviously doesn't save the edited photo as a separate image. The problem is, when I transfer an edited photo to my computer (via Lightning cable) it saves the original, unedited photo on the computer. Is this a bug or is it intentionally not saving the edited photo?
    Whenever I edit a photo and connect my iPhone to my Windows computer, there is a local disk icon(s) in the DCIM folder along with the original photo(s). Meaning, if I edit three photos, there will also be three local disk icons in there as well. If I revert a photo to its original state, the corresponding local disk icon disappears from the Windows Explorer window.

    LR 4.4 uses a large internal colorspace which is ProPhotoRGB with an sRGB gamma curve, so you might want to set your PS RGB workspace to ProPhotoRGB and see if that makes any difference. 
    What is the nature of the difference you’re seeing between the LR version and the PS-CS6-reimported version?  Can we see a screenshot?
    Did things used to work ok and this just started happening or have you just started using LR and/or CS6?

  • Hi   I have Mountain Line with Safari 6.0.2. I used to open Facebook, Youtube, Twitter etc. and everytime I select "Stay signed in" "Remember my password" etc. but it doesn't save my passwords and everytime I have to sign in again. I never sign out from t

    Hi
    I have Mountain Line with Safari 6.0.2. I used to open Facebook, Youtube, Twitter etc. and everytime I select "Stay signed in" "Remember my password" etc. but it doesn't save my passwords and everytime I have to sign in again. I never sign out from these websites but when I open it next time, it requires username & password.
    Does anybody know the problem & solution, plz help. I also found disk erros and reaoired permissiomn and the restarted and did disk utlty again and repaired the same disk errors and then did a restart and still does not remember passwords or ask me. Did all this still no luck it saved apple login on here and saved gmail account but others one it used to save does no longer.here is what i did below and still no luck.
    Instructions
    Set Your Passwords Preferences
    1
    Open up your Safari Web browser and choose 'Preferences' from the Safari pull down menu
    2
    Click on the heading 'AutoFill.'
    Click on the box next to 'User Names and Passwords.'
    4
    Close the 'Preferences' window.
    Save Your Passwords
    5
    Go to a Web page that requires a password and enter in your chosen password. Safari will then ask if you would like to save this password.
    6
    Click on the button 'Yes' in order to save the password.
    7
    Complete steps 1 and 2 for any other passwords that you want Safari to remember.
    Manage Your Passwords
    8
    Go to the 'AutoFill' section in the Safari Preferences window.
    9
    Click on the 'Edit' button to the right of where it says 'User Names and Passwords.' This will bring up a window displaying all of the passwords and usernames that you have authorized Safari to save.
    10
    Click on a password listing and push the 'Remove' button in order to delete the password from Safari's memory.
    11
    Choose 'Remove All' in order to delete all of the saved passwords.
    12

    I suggest that you run software update, after which you should have Safari 6.0.5 - then check Safari - Preferences - Privacy & see that 'Block cookies' is not set to Always.
    Failing that - switch Safari extensions Off via Safari - Preferences - Extensions & test again

  • Safari 5.0.2 doesn't save any more google search results in the history.

    Hello together,
    Safari doesn't save any more google search results in the history.
    Steps to reproduce:
    1.) go to google.com
    2.) search for "APPLE"
    3.) open the history
    Result: the search for "APPLE" is not saved - only the Google mainpage.
    This has something to do with the new search string in the Location bar. Safari does not save URL with /#.
    For example:
    the new string is http://www.google.de/#hl=...
    the old one is: http://www.google.de/search?hl=....
    The change must something to do with the new Google-Search-Feature. When I deactivate it, then google works with the old string and I found the searches in the history.
    The second negative effect is, when you type "apple" into the location bar (after a search), the autocomplete shows the search result, but when you hit enter, you are redirected to the Google-Mainpage.
    Very annoying
    Can somebody confirm.
    Thanks
    Message was edited by: memo_78

    Thanks for your reply!
    Could you post the bug here, too, please:
    http://www.apple.com/feedback/safari.html
    I have done it
    Thanks in advance !
    memo

  • PSE 2.0 doesn't save files on a PC with windows Vista with 2Tb HD while possible on a 500 Gb HD

    on the same PC I use since 4 years I changed the Hard Dusk, PSE 2.0 can read the files from this 2 Tb HD but it doesn't save any file on it while everythibg was OK using the previous HD of 500 Gb : any suggested setting to solve this problem ?

    Unfortunately, this is a problem with old version of PS and PSE. They can't see drives that large.

  • "OK" button doesn't save parameters in Customization Form

    Hi,
    In some portlets of the portal that I am developing, the "OK" button of the customization form doesn't save the portlets parameters. For an effective change in the portlet parameters we must press the "APPLY" button first. This behaviour only happens in some Portlets, in the others, we change the parameters, we press "OK" and that's it. Is it a known problem?
    Best Regards.
    Oracle Portal Version: 9.0.2.3.0B

    Hi Peter,
    Thanks for your reply. I am using simple Portal Dynamic Pages to generate my portlets. So I don't think that we are in presence of a programming bug. Has you surelly know, the customization forms are not controled by the programmer when you generate a portlet based on a dynamic page with parameters.
    Best Regards.

  • [SOLVED] kgpg doesn't save settings

    Hi,
    I've a problem with kgpg: It just doesn't save my settings. Everything that I change (e.g. setting a default key or a key which should always be used for encryption) gets lost when I restart kgpg.
    If I start kgpg in a terminal and change something I get the following message:
    kgpg(14795)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
    That's it. I just found one config file in
    ~/.kde4/share/config/kgpgrc
    And I'm the owner of this file and have full read and write access to it.
    Does anybody else have this problem or knows how to fix it?
    matse
    Last edited by matse (2011-06-14 20:37:27)

    So small update:
    I signed a bug report https://bugs.kde.org/show_bug.cgi?id=275644 and the KDE team could help me, in fact the file "~/.gnupg/gpg.conf" did not exist here on this machine, I created a blank one and now kgpg can use it to write the config to it and everything works fine.
    matse

  • Safari doesn't save passwords for webpages like Facebook, Youtube, Twitter etc.

    Hi
    I have Mountain Line with Safari 6.0.2. I used to open Facebook, Youtube, Twitter etc. and everytime I select "Stay signed in" "Remember my password" etc. but it doesn't save my passwords and everytime I have to sign in again. I never sign out from these websites but when I open it next time, it requires username & password.
    Does anybody know the problem & solution, plz help.

    Instructions
    Set Your Passwords Preferences
    1
    Open up your Safari Web browser and choose 'Preferences' from the Safari pull down menu
    2
    Click on the heading 'AutoFill.'
    Click on the box next to 'User Names and Passwords.'
    4
    Close the 'Preferences' window.
    Save Your Passwords
    5
    Go to a Web page that requires a password and enter in your chosen password. Safari will then ask if you would like to save this password.
    6
    Click on the button 'Yes' in order to save the password.
    7
    Complete steps 1 and 2 for any other passwords that you want Safari to remember.
    Manage Your Passwords
    8
    Go to the 'AutoFill' section in the Safari Preferences window.
    9
    Click on the 'Edit' button to the right of where it says 'User Names and Passwords.' This will bring up a window displaying all of the passwords and usernames that you have authorized Safari to save.
    10
    Click on a password listing and push the 'Remove' button in order to delete the password from Safari's memory.
    11
    Choose 'Remove All' in order to delete all of the saved passwords.
    12

  • Firefox doesn't save the settings

    As the question might say this version of Firefox (5.0.1) doesn't save the settings u do to it...For example my problem is with the toolbar and the buttons i add to it...i have tried to customize it as i previously had it in the earlier versions of firefox but it doesn't save them...i need to customize them from the beginning whenever i close and open firefox...even when it updates the add-on's and restarts it still needs to be customized...i have also checked many forums and apparently i am not the one having the same problem...some also can't save the bookmarks but that is not my case...i have recently downloaded a Premuimplay Codec-c add on and also a Facemoods and maybe ththose interfere with firefox even though i doubt it
    The addon's that i definitely wanna keep on the toolbar are IMTranslator,WOT,Read It Later,Save-To-Read,ADBlock Plus and also the Home button never stays in the place i move him when i customize the toolbar
    Regards
    Albi
    PS:(some add-ons don't work with firefox 5.0.1 but i guess thats the developers problems right?

    Firefox 4 saves the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.
    Another possibility is to use:
    * [http://kb.mozillazine.org/Menu_differences Firefox (Tools) > Options] > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

Maybe you are looking for

  • 5 hours to install Leopard 10.5 on 24" iMac 2.8 (2008-Dec purchase)?

    We were running SL on the 24" iMac for several months w/o a glitch, then after a power failure (Storm in DC), every action was taking forever and the spinning color ball was present more than not. So, we ran Disk Utility (DU) and found internal HD in

  • PSD files missing plugin

    When I drag and drop a picture from Aperture that was processed through photoshop and a filter (like Nik) and it is saved as a PSD, when that image is pulled over to FCPX, I get a missing plugin message.  When I do the same process, but as a tiff it

  • How are BAPI's related to conversions

    Hi, I would like to know how can we do conversions using BAPI's. Is conversion through BAPI preferred over BDC or call transaction?? Thanks, Haritha

  • Is it possible to use a variable semantically as an invisible "column"?

    Here is a simple query that produces a table: let     Source = #table(     type table [First= number, Second= number],      {{1,1}, {2,4}, {3,4}}     ),     #"Added Custom" = Table.AddColumn(Source, "Custom", each [First]+[Second]) in     #"Added Cus

  • Form scrambled in Firefox

    I have a fillable form on our website.  It works fine in Chrome and IE.  However, if I click on the form's link in Firefox, I get a mess and a message at the top that says "This PDF document might not be displayed correctly". And the option to open i