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

Reconstructing Outlook emails with attachments from SQL Blobs



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 14th 08, 03:05 PM posted to microsoft.public.outlook.program_vba
JW
external usenet poster
 
Posts: 10
Default Reconstructing Outlook emails with attachments from SQL Blobs

I have a SQL database with the Outlook message saved to a blob without the
attachments. The attachments are saved to separate rows in another table. I
would like to reconstruct the message with the attachments. If I extract the
message to a .msg file, the attachments are missing. They were somehow
stripped off. I can also extract the attachments separately. I would like to
be able to reconstruct the whole message, including attachments, to be able
to display it in Outlook so the user can click on the attachment icons in the
email and display it. Anybody got any ideas as to how to code this (C#
preferred). - Thanks in advance
  #2  
Old May 14th 08, 05:47 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Reconstructing Outlook emails with attachments from SQL Blobs

Import the mesage to Outlook, then add attachments using
MailItem.Attachments.Add.
Are you simply saving the messages as MSG files so that users can open them
from Windows Explorer or import them to Outlook?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"JW" wrote in message
news
I have a SQL database with the Outlook message saved to a blob without the
attachments. The attachments are saved to separate rows in another table.
I
would like to reconstruct the message with the attachments. If I extract
the
message to a .msg file, the attachments are missing. They were somehow
stripped off. I can also extract the attachments separately. I would like
to
be able to reconstruct the whole message, including attachments, to be
able
to display it in Outlook so the user can click on the attachment icons in
the
email and display it. Anybody got any ideas as to how to code this (C#
preferred). - Thanks in advance



  #3  
Old May 14th 08, 06:44 PM posted to microsoft.public.outlook.program_vba
JW
external usenet poster
 
Posts: 10
Default Reconstructing Outlook emails with attachments from SQL Blobs

"Dmitry Streblechenko" wrote:

Import the mesage to Outlook, then add attachments using
MailItem.Attachments.Add.
Are you simply saving the messages as MSG files so that users can open them
from Windows Explorer or import them to Outlook?


The messages are blobs in the database so that they can be linked to other
database rows/objects. They are being exported from the database to msg
files so that they can be displayed in Outlook interface in their original
format. If we could "stream" them directly to the Outlook interface, that
would be even better that exporting them into msg files first. How to I
import the blob direcly into Outlook? In addition, the msg file already
shows that the attachment is there, except when you click on it, it really
isn't there. If I do an Attchment.Add, won't there now be two copies of the
attachment showing, one that works and one that doesn't?
  #4  
Old May 14th 08, 07:27 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Reconstructing Outlook emails with attachments from SQL Blobs

You could use Aplication.CreateItemFromTemplate, but it wipes out the sender
related data and the message is created in the unsent state. You could use
Redemption to import them (RDOFolder.Items.Add / RDOMail.Import).
What do you mean by "msg file already shows that the attachment is there,
except when you click on it, it really isn't there"?
On the low level, were the attachments left in place by PR_ATTACH_DATA_BIN
property removed (look at the MSG file with OutlookSpy - click Misc |
OpenIMsgOnIStg)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"JW" wrote in message
...
"Dmitry Streblechenko" wrote:

Import the mesage to Outlook, then add attachments using
MailItem.Attachments.Add.
Are you simply saving the messages as MSG files so that users can open
them
from Windows Explorer or import them to Outlook?


The messages are blobs in the database so that they can be linked to other
database rows/objects. They are being exported from the database to msg
files so that they can be displayed in Outlook interface in their original
format. If we could "stream" them directly to the Outlook interface, that
would be even better that exporting them into msg files first. How to I
import the blob direcly into Outlook? In addition, the msg file already
shows that the attachment is there, except when you click on it, it really
isn't there. If I do an Attchment.Add, won't there now be two copies of
the
attachment showing, one that works and one that doesn't?



 




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
Reconstructing Deleted Distribution List Barry Outlook - Using Contacts 3 May 8th 08 07:24 PM
Saving Attachments From Outlook Emails JOSEPH WEBER Outlook and VBA 1 May 2nd 08 03:51 PM
Reconstructing Outlook Ignoramus Outlook - General Queries 4 September 16th 07 04:36 AM
sending emails in outlook 2007 with attachments [email protected] Outlook - General Queries 0 July 9th 07 12:42 AM
Showing attachments when printing emails from Outlook 2002, XP Isissoft Outlook - General Queries 4 March 31st 07 08:04 PM


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