Office Interop 32 bit on 64 bit OS email attachments filling up outlook temp folder OLK

I have an issue when sending emails (many) using Office.Interop 32 bit that when the application is installed on a 64 bit OS the outlook secure temp is filling up and throwing an exception, this does not occur when the application is installed on a 32 bit
OS.
.NET framework 4.0
Visual Studio 2010 (C#)
Microsoft.Office.Interop.Outlook 14.0.0.0 Runtime v2.0.50727
for (int i = 0; i < 300; i++)
Microsoft.Office.Interop.Outlook.Application outlookApplication = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook._MailItem oMailItem = (Microsoft.Office.Interop.Outlook._MailItem)outlookApplication.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
oMailItem.Recipients.Add("[email protected]").Type = 1;
oMailItem.Subject = "test email";
oMailItem.BodyFormat = OlBodyFormat.olFormatHTML;
oMailItem.Save();
oMailItem.Attachments.Add(@"C:\test_doc_1.docx", (int)Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, Type.Missing, Type.Missing);
oMailItem.Attachments.Add(@"C:\test_doc_2.docx", (int)Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, Type.Missing, Type.Missing);
oMailItem.Send();
Win7 32bit with Outlook 2010 32bit -> Works on this setup
Win7 64bit with Outlook 2010 32bit -> Does not work on this set up
Problem:
Sending many emails with the same attachment fills the outlook secure temp folder 
C:\Users\[User]\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\ZT7WMFGK\
(with a temp copy of the attachment) these files are not removed on Win7 64bit so at about 200 emails the exception is thrown:
"Cannot create file [file name]. Right-click the folder you want to create the file in, and then click Properties on the shortcut menu to check your permissions for the folder."
On Win7 32bit i can see the files getting automatically deleted from the secure temp folder so there is no problem
Im not sure where to start with this.

Seems that you have to release the objects explicitly. According to articles (http://www.bing.com/search?q=c%23%20release%20com%20objects), try this:
Application outlookApplication =
new
Application();
_MailItem oMailItem = (_MailItem)outlookApplication.CreateItem(
OlItemType.olMailItem );
var recipients = oMailItem.Recipients;
var recipient = recipients.Add(
recipient.Type =
1;
oMailItem.Subject =
"test email";
oMailItem.BodyFormat =
OlBodyFormat.olFormatHTML;
oMailItem.Save();
var attachments = oMailItem.Attachments;
var attachment1 = attachments.Add(
@". . . .", (int)OlAttachmentType.olByValue,
Type.Missing,
Type.Missing );
var attachment2 = attachments.Add(
@". . . .", (int)OlAttachmentType.olByValue,
Type.Missing,
Type.Missing );
oMailItem.Send();
Marshal.ReleaseComObject( attachment2
Marshal.ReleaseComObject( attachment1
Marshal.ReleaseComObject( attachments
Marshal.ReleaseComObject( recipient );
Marshal.ReleaseComObject( recipients
Marshal.ReleaseComObject( oMailItem );
Marshal.ReleaseComObject( outlookApplication
Check (with Debugger) that the files are removed at the end of this fragment.
Also consider creating a single outlookApplication before the loop.

Similar Messages

  • When I want to save a PDF attachment to an email, it defaults to a temp folder.  How do I change the default folder?

    When saving a PDF attachment to an email, I want to change the default folder.  How do I do that?

    Hi brs texas,
    Do I understand correctly that you're downloading a PDF that you received in an email? The default save location is a function of the email client, not of Acrobat or the PDF, so steps to change that folder would vary by email client. Please check the documentation for your email.
    Best,
    Sara

  • Automator workflow to download email attachments in a daily created folder

    dear forum participants and apple experts: i have created an intelligent mailbox in apple mail in which mail from a certain sender which has been sent on a certain day (normally today) is filed. Would it be possible to create an automator/apple script file to download all attachments these files contain into a specific folder and to label that folder with the date (thus today's date).
    I have succeeded in downloading attachments in a folder that was automatically labed with the date by using the email filter (without the detour of an intelligent mailbox) and despite the filter setting for a specific date, it always downloaded all attachments from all the dates the specfic sender has sent emails
    so i have created this intelligent mailbox in the apple mail in which mail from a certain sender which has been sent on a certain day (normally today) is filed. Would it be possible to create an automator/apple script file to download all attachments these files contain into a specific folder and to label that folder with the date (thus today's date).
    I have succeeded in downloading attachments in a folder that was automatically labed with the date by using the email filter (without the detour of an intelligent mailbox) and despite the filter setting for a specific date, it always downloaded all attachments from all the dates the specfic sender has sent emails.
    any help would be greatly appreciated. thx a lot in advance

    First try to do the same tasks in Safe Mode:
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that temporarily turns off hardware acceleration, resets some settings, and disables add-ons (extensions and themes).
    '''If Firefox is open,''' you can restart in Firefox Safe Mode from the Help menu:
    * Click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    '''If Firefox is not running,''' you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".
    ;[[Image:SafeMode-Fx35]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, theme, or hardware acceleration. Please follow the steps in the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • Why i couldn't open email that sent from Outlook?

                     Please help me for this matter, i had bought my BB Curve 8520 for just only 5 days and use latest firmware. I have setup 2 emails 1.) hotmail  2.) Outlook (Official mail) i found this issue after i had setup my office email for a few days.
                    Issue is when i open email that sent from Outlook (Official mail) that contained file .png or attached with file .png by using HTML  my bb couldn't open it, it will stuck but i can use any function but just the email that didn't open.
                    I ha contacted with my Local support, they inform me to do the hard reset, after i had hard reset it working fine with same email that couldn't open previously. After one day had past it has the same issue again.
    Please help me to fixed this issue, thank you in advance.
    P.S. I had never install any unauthorized program.

    Photoshop doesn't do anything special or different when a file is sent from an attachment. However, when you send an attachment from Outlook to Photoshop, that file is actually downloaded to your computer in a Temp folder before it is sent to Photoshop. Often times the permissions on this folder can be such that it prevents access. Other than that, all Outlook does is simply drop the file onto the Photoshop app file. The only thing that would involve Photoshop directly is if there are some damaged files involved with its connection to the rest of the system. If this is the case a reinstall would fix it. Otherwise, check the permissions on the Outlook temp folder (or at least the JPEG file it is trying to save).

  • Why does Reader XI download email attachments to my Download folder before I am able to print them?

    After last update my Reader XI automatically downloads email attachments (.pdf) to my Downloads folder. I then have to open that file in order to print it.  Before, the attachment would open in Reader and I could print from that direct.

    Windows 8, Firefox email client.  What happens is that I click on attachment links in emails, which are .pdf files.  Instead of a menu allowing opening of the file with Reader, the file gets automatically downloaded to my Downloads folder.  I then have to open that folder, click on the file name... then Reader opens and I can view the file as well as print it from the Reader menu.

  • Install office(64) instead of 32-bit

     I have uninstall the 32-bit office and install the 64-bit. but it  shows " we can't install the 64-bit  version of office becouse we found the following 32-bit pr on your pc:,     
    office 15 click-to-run extensibilyty component.               please uninstall all 32-bit office pr, thn retry installing office 64 bit " 
    But I allready uninstall all and still it's show this notification

    Hi abdhullah,
    What is the present office version ? What is the system architecture ?Just as Milos said we can`t install a 64 bit software in a 32 bit system .
    Please check the following link and try the fix it tool in it according to your symptom .
    How to uninstall Office 2003, Office 2007 or Office 2010 suites if you cannot uninstall it from Control Panel?
    http://support.microsoft.com/kb/971179
    How to uninstall Office 2013 or Office 365
    http://support.microsoft.com/kb/2739501
    For more information about installing issue ,it is recommended to post the case in our office forum.
    https://social.technet.microsoft.com/Forums/office/en-US/home?category=officeitpro
    Best regards

  • Office Standard 2013 Key Management Service host 32-bit or 64-bit version ?

    Hello,
    I have a 2012 DomainController serving as our KMS host.
    I need to activate 2013 Lync 32-bit clients so I will have to install the office 2013 KMS host.
    The KMS host download is available in both 32-bit and 64-bit.
    Should I download the 64-bit version because the 2012 OS is 64 bit or will I download the 32-bit host since the Office version we use is 32-bit?
    BR
    Sverre Amundsen

    Hi,
    Based on my understanding, I suppose that you want to activate 32-bit version of Lync 2013. Is it right?
    If so, you can only install 32-bit version of Office 2013 on your PC. The 32-bit and 64-bit versions of Microsoft Office programs don’t get along, so you can only have one type installed at a time. If you mix 32-bit and 64-bit version installed
    on the same PC, you might see some errors.
    Reference about why can’t I install both the 32-bit and 64-bit versions of Office 2013:
    http://office.microsoft.com/en-001/access-help/why-cant-i-install-both-the-32-bit-and-64-bit-versions-of-office-2013-HA103523746.aspx
    By the way, there is an article about choosing 32-bit or 64-bit version of Office.
    http://office.microsoft.com/en-001/support/choose-the-32-bit-or-64-bit-version-of-office-HA102840825.aspx
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Should I have installed Microsoft Office 2010 Filter Pack 64 bit with Ex 2013 SP1?

    I have installed Exchange 2013 SP1 on a 2012R2 server, and all went well (I am at early stages of migration).
    Following the pre-reqs listed here: https://technet.microsoft.com/en-us/library/bb691354%28v=exchg.150%29.aspx#WS2012
    I installed Microsoft Unified Communications Managed API 4.0, Core Runtime 64-bit only.
    Since then I have seen other articles suggesting that I install:
    Microsoft Office 2010 Filter Pack 64 bit
    Microsoft Office 2010 Filter Pack SP1 64 bit
    Given I didn't notice any errors in the install, do I need to install those filter packs or is that outdated advice?
    regards
    Roga

    Thanks for taking the time to post Ed
    I did a bit more research and it appears that there is more than one view on this.
    E.G. this blog
    Why Exchange 2013 doesn’t need the Microsoft Office Filter Pack says:
    "Exchange 2013 swaps MSSearch for the Search Foundation, a component shared with SharePoint 2013. The Search Foundation has no need of the Office Filter Pack because it includes its own filters. Unfortunately, until SP1 came along,
    the Exchange 2013 Setup program overlooked this fact and stated that the Office Filter Pack was a prerequisite. Setup would install if the Office Filter Pack was missing, but who’s going to ignore a warning issued by Setup. In any case, that warning seems
    to have finally been suppressed."
    This blog
    Planning and migrating a small organization from Exchange 2007 to 2013 (Part 10) has:
    "After choosing the relevant setting needed to begin installation, the Exchange 2013 setup program will now perform readiness checks. Assuming these complete successfully, we'll expect to see just one warning.
    This warning relates to the lack of the Office 2010 Filter Packs, which are not required for installation, and are only required to create Transport Rules for OneNote or Publisher files"
    And this one
    Exchange Server 2013 FAQ: Is the Office Filter Pack Required?
    "The Exchange 2013 pre-requisites page on
    TechNet, at the time of this writing, does include the Office Filter Packs as a step in the preparation of a server for Exchange 2013. What it doesn’t make clear is that they are not required.
    The new Exchange Search already has support for indexing/searching Office file types, as well as a series of other file types including some third party formats such as PDF. You can see a full list
    here.
    So should you install the Office Filter Pack? If you want to stop seeing that warning message, then yes. If you want to take the approach of only installing required software on your servers, then no. Consider also that installing it means potentially having
    to update it later on if there is a bug fix or a security issue."
    The final para above is the approach that I have now taken, but if someone can give me a good reason to install office 2010 filter packs on Ex 2013 sp1 I'll revise my view
    regards
    roga

  • Excel COM object calls break with Office 2013 upgrade on 64-bit OS?

    Out of the 1000+ computers in the company mine is the only one running 64-bit windows 7.  I have noticed that when i try to run a small DLL i created to convert Excel files to Tab Delimited files it is crashing only on my computer.
    I have debugged the source code and found that there is no real exception being thrown except a popup does appear in the background stating "We're sorry, but Excel has run into an error that is preventing it from working correctly. Excel will need to
    be closed as a result.  Would you like us to repair now? [Repair Now][Help][Close]"
    If i open excel via the main application this same popup comes up and when i click repair excel closes.  when re-opened Excel re-activates and then works fine.
    here is a sample of my (VERY simple) code which has worked for years on office 2007 with 64-bit OS:
    Dim excelPath As String = "C:\test.xlsx"
    Try
    objXL = CreateObject("Excel.Application")
    With objXL.Application
    .displayalerts = False
    .Visible = False
    .workbooks.Open(excelPath)
    .Workbooks(ExcelFileName).SaveAs(csvPath & csvFileName, Excel.XlFileFormat.xlCurrentPlatformText, , , , , Excel.XlSaveAsAccessMode.xlNoChange, , , , , )
    .workbooks(csvFileName).Close(csvPath & csvFileName, savechanges:=True)
    End With
    Catch ex2 As Exception
    Throw ex2
    Finally
    objXL.Quit()
    objXL = Nothing
    End Try
    I have isolated the exact line that is causing the exception to be thrown... 
    .Visible = False 
    Why would hiding the Excel UI cause an error of "We're sorry, but Excel has run into an error that is preventing it from working correctly" to be displayed?
    If i remark out this line then the application seems to work properly for me...

    That I do not know. Do you have another machine where Office 2013 is installed, and where you can test? It could be system configuration issue, could be a change in the application behavior or a difference between 32-bit and 64-bit. You are updating
    at least a couple of generations of software and now running in a 64-bit environment so there is always the potential for changes in behavior and software defects.
    Unfortunately, I do not have Office 2013 64-bit installed so I cannot test this scenario.
    You could also try posting to the
    Excel for Developers forum to see if anyone has encountered the same issue when using Excel automation.
    Paul ~~~~ Microsoft MVP (Visual Basic)

  • Smart View 11.1.2.5 with Office 32 Bit and 64 Bit

    Hello,
    Does anyone know if it's possible to install Smart View 11.1.2.5.210 on MS Office 2013 32 Bit and MS Excel 2013 64 Bit on the same machine? We have users that have both Office 2013 32 Bit and Excel 2013 64 Bit installed. It seems like when we run the SmartView.exe it is looking for the full Office 2013 64 Bit suite and it won't install for just Excel 2013 64 Bit. I'm not sure if it's an issue having both 32 bit and 64 bit or if it's because we don't have the full 64 bit Office suite installed.
    Thanks!

    It does not look for the full Office suit.
    Do you have Office 32-bit and Office 64-bit installed on the same machine?
    Thanks

  • Lync 2013 - Office 32 bit cannot connect when attemtping to share from preset Outlook Meeting

    I have Office 2013 32 bit version installed on my computer running Win7. I cannot use 64 bit as another software that I run will not work with 64 bit.
    When I set up a meeting in Outlook 2013, and set it as a Lync Meeting, I can start the meeting and people can call in and connect. When I attempt to share my desktop or monitor or anything, it does not connect to allow me to share. If others in the meeting
    attempt to share their desktop, the same happens. I get a Connecting Icon at the top of the screen and then eventually a message that says cannot connect to the server. This happens everytime, I try to do a Lync meeting this way.
    If I call someone with Lync and Share my desktop or monitor, I am able to share with no issues.
    I have tried, uninstalling and reinstalling Lync. I have tried to install latest updates. I have tried to repair office. None of these work.
    Others in our office with the same set up do not have this issue.
    Any ideas how to resolve this?
    Dave

    Hi,
    It may cause by the issue of the FE server MCU, please double check if MCU on FE server works well, when two participants are connected, the session is essentially peer-to-peer. When three or more participants are connected, the desktop
    Sharing feature depends on the Front End Server Multi Point Control Unit (MCU) to provide the sharing stream to all parties.
    Please check if port 5065/TCP is available on Front End server.
    Please also troubleshooting with the help of Recommended Steps
    part in the link below:
    http://blogs.technet.com/b/nexthop/archive/2012/11/05/lyncmd-troubleshooting-lync-server-2010-application-sharing-internal-and-remote-scenarios.aspx
    Eason Huang
    TechNet Community Support

  • Creation of Add-on package for 64 bit and 32 bit SAP Business One Client

    Please help me creating package for 64 bit and 32 bit SAP Business One. If Add-on executable is compiled with x86 option then there is no issue of connecting Add-on with 32 bit SAP Business one and if Add-on executable is compiled with Any CPU option then there is no issue of connecting Add-on with 64 bit SAP Business one. Problems are mentioned as below
    1. My Add-on uses MS ACCESS connection and the connection is read using Jet OLEDB 4.0 provider. It works fine for x86 compile mode but not when compile mode is Any CPU. I searched for the issue on Google and found a solution to change MS ACCESS connection provider to ACE.OLEDB.12.0 but again ACE provider is installed according to the Office version i.e. 32 bit or 64 bit office suite. If I install 32 bit ACE provider then Add-on executable compiled with x86 version is working fine but with Any CPU option throws error as provider is not registered on current machine.
    2. Secodly, our license validation activex dll is build using vb 6.0 and therefore when Add-on executable is compiled using Any CPU option, Add-on EXE cannot read from license dll. Any suggestion, how the activeX dll can be compiled whose component can be created from for X86 compiled exe and any cpu compiled exe.
    Please help because we are stuck in this issue and cannot move forward.
    Thanks.

    Hi Alejandro,
    That is one solution but did your add on used ms access connection? if you used Jet oledb to connection string or ace oledb connection string? what if 32 bit office is installed and what if 64 office is installed? how did you found the office version in install script? after determining the office version how did you installed Microsoft redistributable for ace oledb (32 bit or 64 bi )?
    I am sorry that I asked many questions but these are the problems where I am stuck with the addon installer?
    Thanks

  • Separate GPO for 32-bit and 64-bit machines?

    Before I give myself a whole load of work wanted to confirm this either way...
    We're imaging both 32-bit and 64-bit Windows 7 this summer (x86 for app compatibility and x64 for Adobe CS6 etc). So far I've made a full working policy for x86 but now need to do x64.
    When I created the initial policy on a 32-bit machine the ZCM console automatically seems to add a requirement of Architecture = 32-bit which suggests the policy can only be used on that version of the OS - do I need to create a separate x64 policy from scratch or can the x86 GPO be applied (and work consistently and be supported) on the x64 machines?

    Yes unfortunately you have to create your policies with the bit version of
    the OS. So you have to do it with a 32bit and 64bit machine.
    "gshaw0" wrote in message news:[email protected]..
    Before I give myself a whole load of work wanted to confirm this either
    way...
    We're imaging both 32-bit and 64-bit Windows 7 this summer (x86 for app
    compatibility and x64 for Adobe CS6 etc). So far I've made a full
    working policy for x86 but now need to do x64.
    When I created the initial policy on a 32-bit machine the ZCM console
    automatically seems to add a requirement of Architecture = 32-bit which
    suggests the policy can only be used on that version of the OS - do I
    need to create a separate x64 policy from scratch or can the x86 GPO be
    applied (and work consistently and be supported) on the x64 machines?
    gshaw0
    gshaw0's Profile: http://forums.novell.com/member.php?userid=135427
    View this thread: http://forums.novell.com/showthread.php?t=467454

  • CUVA with Win 7 (32 Bit and 64 Bit) OS

    Hi All,
    Our users are facing issues with CUVA 2.1.2.0 [ CDP 2.1(0.6) ] with Windows 7 32 Bit and 64 Bit.
    On Windows 7 the CDP Driver and version is visible but not on Windows 7 64 Bit.
    On both the operating systems, users are not able to access the CUVA video. The status of the link between IP Phone and video is showing as disconnected.
    I know of a old document on Cisco website which says its not compatible...Any alternatives?? updates??
    Thanks in advance.
    Regards,
    Ifthiquar

    FYI - I have installed Win 7 64-bit on a 3 year old dual core dell inspiron 6400 with 2GB of ram and it is running beautifully.  So far, I have not seen any issues with 2GB of RAM.  Boot up really fast.  browsing seems faster, MS Office works great.
    My new T400s will be next - just a bit nervous as i want to make sure that all the necessary drivers are available.

  • 64-bit or 32-bit Intel?

    I am assuming these new Intel machines are still the old 32-bit style. Is this correct? What are we sacrificing for back stepping? I work in a PC environment office with my G5 and it's amazing how much clearer and brigher my monitor (we all have the same one) looks next to the others.

    Jim,
    As as software engineer who has worked in various application and systems areas and over the era of transition from 16-bit to 32-bit hardware, I can only agree with you that choice of hardware must be dictated by the needs of the use to which it will be put. So clearly for today's desktops (and even more so for laptops), 32-bit hardware is certainly adequate. Whether or not disk speeds are a factor also depends on the application. Obviously, database-intensive applications typically run the mass storage devices ragged. Other applications barely touch the disk once the program and its data are loaded.
    Anyway, what I really wanted to point out, though you're probably aware of this already, is that the new iMac (Intel dual-core model) and the MacBook Pro both use faster memory and memory buses than any of their predecessors (with the possible exception of the heavy-duty G4 or G5 desktops--I'm not really familiar with their hardware details).
    To give you an idea of a result I found surprising (pleasantly so), a theorem prover I've written in Java (a very CPU- and memory-intensive application) runs much faster (about 50% faster) on the iMac with its dual-core 2 GHz processor(s) than it does on the Linux box with an Intel P4 HyperThreading CPU running at 3 GHz. The reason? The RAM and FSB bus on that Linux box are a lot slower than the ones on the iMac. So even though this application, which currently is principally single-threaded (Java apps can always use a processor core for garbage collection), benefits more from the faster FSB and RAM on the iMac than it is hurt by having a processor running only two thirds the speed of the on in the Linux box.
    Randall Schulz
    iMac 20" Core Duo; MacBook Pro   Mac OS X (10.4.5)  

Maybe you are looking for

  • Is it possible to insert two VO in a table?

    Hi, experts During developing OAF page, i need to use two VO in a table. Is it possible?     or Not? If I can't,  how come i can use Two VO together like JOIN function in DB query.

  • Error in converting varchar into dd/mm/yyyy

    Hi all, i need to insert the "date_of_birth" in 'dd/mm/yyyy'. but in master table "date_of_birth" column is in Varchar2(15),and values in the master tables are not in proper format. i.e) some values are like *'21-jan-1988'*, and some are like *'01/21

  • Why does Spaces automatically switch away from my active window?

    I'm having the weirdest problem. As of a few days ago, whenever I use an app in full screen mode, this thing happens: after about ten or twenty seconds, the app will switch away from my active window, and show the desktop. What's also weird about it

  • Oracle.jbo.TooManyObjectsException but validated unique keys?

    11gR1 ADF I have some code similar to the code that copies the transient cart to the persistent card from the FOD, and I've receiving the TooManyObjectsException error even though I've validated that the key is unique.             for(Row tItemRow :

  • How to get CSS to display correctly in IE

    I am having a HORRIBLE time getting my site to look right in IE - weird thing is, I have IE7 on a Windows Platform (through parralells on my Mac) and I can get it to look fine, but my client has IE7 - and the logo is always "out of bounds" I am new,