Drag and Drop Outlook Contact

MS OFFICE OUTLOOK

    Next

  • 1. translated contact item properties
    Maybe a stupid question: I am working on on getting a complex contact database transfered to outlook and need to know how or where I can find a mapping between the english property names and the (in my case) assosiated german localized field names. e.g. I can't find the german "notizen" field (notes or similar?) (And I am sure I run into more issues. Thanks for any help! tb
  • 2. How to intercept an attachment "Save As" in outlook
    I have succesfully written a visual basic com add-in application that intercepts the saving of attachments when clicking "File / Save Attachments" on an open Mail in Outlook 2002, However I would also like to intercept the "save as" that comes up when you right click on the attachment - does anyone know how I can do this - I can't find the command in any of the command bars or the active menu?
  • 3. Assistance with folder creation
    Hi, I have some users using outloo 2000 and outlook 2003. I need to deploy a vbs script which can create a folder in theit inbox and sent items and also create a rule to filter emails based on a specific subject line to the folders created in the inbox and sent items. Is this possible? Wher can I find info on this or couls someone provide a similar sample. Thanks

Drag and Drop Outlook Contact

Postby UmFuZHkgUm9nZXJz » Fri, 28 Apr 2006 23:43:02 GMT

Hi,
I am trying to drag and drop an Outlook 2003 contact onto my win32 
application.  I can see from the FileGroupDescriptor/FileDescriptor the 
filename MyContact.msg.
When I try to get the FileContents, i get an invalid index error.  I can 
successfully drag and drop an email attachment onto my application but can't 
seem to get the Contacts, Tasks, etc via Drag and Drop.  I know there is 
'some' data available in text format, but I want the actual msg file.  For 
example I might want to drag and drop a contact onto my application and save 
the msg file locally.  The documentation is elusive.  Can someone point me to 
sample code that shows how to drag a contact from outlook to another win32 
application and have the dropped msg saved as a local file???  Thanks in 
advance...
-- 
Regards,
Randy

Re: Drag and Drop Outlook Contact

Postby Dmitry Streblechenko » Sat, 29 Apr 2006 02:46:20 GMT

What is your code?

Dmitry Streblechenko (MVP)
 http://www.**--****.com/ 
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool








Re: Drag and Drop Outlook Contact

Postby UmFuZHkgUm9nZXJz » Sat, 29 Apr 2006 05:29:02 GMT

i Dmitry
In my profile I mention I program in Clarion programming language. I hope
you can translate. The code below works file if I drag and drop a text file
attachment but if I drop an outlook contact I get 80040068 invalid index
error on the following statement:
hr = pDataObject.RemoteGetData(ADDRESS(fmtetc), ADDRESS(stgmed))

If you can provide any kind of example I can translate to my tool...

here is my code:
bDropHandled = FALSE
pNewString &= NEW(STRING(SIZE(tagFORMATETC)))
fmtetc &= ADDRESS(pNewString)
IF ~fmtetc &= NULL
kcr_memset(ADDRESS(fmtetc),0,SIZE(tagFORMATETC))
fmtetc.cfFormat = SELF.m_cfFileContents
fmtetc.ptd = 0
fmtetc.dwAspect = DVASPECT_CONTENT
fmtetc.lindex = -1
fmtetc.tymed = TYMED_ISTREAM

IF pDataObject.QueryGetData(ADDRESS(fmtetc)) = S_OK
bDropHandled = TRUE
pNewString &= NEW(STRING(SIZE(STGMEDIUM)))
stgmed &= ADDRESS(pNewString)
IF ~stgmed &= NULL
kcr_memset(ADDRESS(stgmed),0,SIZE(STGMEDIUM))
hr = pDataObject.RemoteGetData(ADDRESS(fmtetc), ADDRESS(stgmed))
IF hr = S_OK
thisStream &= (stgmed.u.pstm)
hr = thisStream.Stat(ADDRESS(statstg), 0)
IF statstg.cbSize.highpart = 0
cb = CHOOSE(statstg.cbSize.lowpart <
SIZE(OleDataBuffer)-1,statstg.cbSize.lowpart,SIZE(OleDataBuffer)-1)
hr = thisStream.Read(ADDRESS(OleDataBuffer), cb, cbRead)
END
thisStream &= NULL
kcr_ReleaseStgMedium(stgmed)
DISPOSE(stgmed)
stgmed &= NULL
POST(SELF.m_OleDropEvent)
ELSE
kcr_itoa(hr,hr_hex,16)
MESSAGE('RemoteGetData(' & fmtetc.lindex & ') returned ' &
hr_hex)
END
END
END
DISPOSE(fmtetc)
fmtetc &= NULL
END
pNewString &= NULL
IF bDropHandled = TRUE
RETURN hr !<<<------Return before default code executes
END


--
Regards,
Randy


"Dmitry Streblechenko" wrote:


Re: Drag and Drop Outlook Contact

Postby Dmitry Streblechenko » Sat, 29 Apr 2006 05:58:48 GMT

here did you get the definition of IDataObject from? It looks like the
MSHTML TL calls GetDataHere method (that's the original name) RemoteGetData.
What you need to use is GetData (the very frst method of the IDataObject
interface).

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

"Randy Rogers" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...



Re: Drag and Drop Outlook Contact

Postby UmFuZHkgUm9nZXJz » Sat, 29 Apr 2006 11:51:01 GMT

i Dmitry
yes, remotegetdata is the name given to the getdata method (not getdatahere
method) in my interface definition. As noted, this works fine with dropped
email attachment, but not dropped contact or task. Can you provide sample vb
or other code to show how to save a dropped msg type file to a local folder.
I am not ruling out something I have prototyped wrong, but it does seem a
bit strange that I can handle an email attachment but get error on
contactdrop.
Thanks for you help
--
Regards,
Randy


"Dmitry Streblechenko" wrote:


Re: Drag and Drop Outlook Contact

Postby Dmitry Streblechenko » Sun, 30 Apr 2006 02:55:06 GMT

ou need to retrieve CF_FILEDESCRIPTOR first (it will give you the file
names and the count of files), then loop through all the files asking for
each file's CF_FILECONTENTS
You need to set PFormatETC.lIndex to 0 through count -1 on each step:

dfFile :
begin
pFE:=FindFormat(CF_FILEDESCRIPTOR, Formats);
pFC:=FindFormat(CF_FILECONTENTS, Formats);
if (pFE <> nil) and (pFC <> nil) then begin
//File descriptor
if S_OK = dataObj.GetData(pFE^,Medium) then begin
Stream:=MediumToStream(Medium);
if Stream <> nil then begin
GetMem(pFileDesc,Stream.Size);
Stream.Read(pFileDesc^,Stream.Size);
for i:=0 to pFileDesc^.cItems-1 do begin
FileName:=pFileDesc^.fgd[i].cFileName;
pFC^.lindex:=i;
res:=dataObj.GetData(pFC^,Medium2);
if S_OK = res then begin
Stream2:=MediumToStream(Medium2);
if Stream2 <> nil then begin
if ExtractFilePath(FileName) = '' then begin

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

"Randy Rogers" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...



Re: Drag and Drop Outlook Contact

Postby UmFuZHkgUm9nZXJz » Sun, 30 Apr 2006 05:51:01 GMT

i Dmitry
Here is what I did to get this to work. When calling GetData I request
TYMED_ISTREAM | TYMED_ISTORAGE and GetData responds with a *IStorage pointer.
I then use StgCreateStorageEx to create a local store and then ise
IStorage.CopyTo to save it to the local hard drive. Thanks for all of your
assistance.
Here is my Clarion code for those interested:

fmtetc.cfFormat = SELF.m_cfFileContents
fmtetc.ptd = 0
fmtetc.dwAspect = DVASPECT_CONTENT
fmtetc.lindex = -1
fmtetc.tymed = BOR(TYMED_ISTREAM,TYMED_ISTORAGE)
IF pDataObject.QueryGetData(ADDRESS(fmtetc)) = S_OK
bDropHandled = TRUE
pNewString &= NEW(STRING(SIZE(STGMEDIUM)))
stgmed &= ADDRESS(pNewString)
IF ~stgmed &= NULL
kcr_memset(ADDRESS(stgmed),0,SIZE(STGMEDIUM))
fmtetc.lindex = 0
hr = pDataObject.GetData(ADDRESS(fmtetc), ADDRESS(stgmed))
IF hr = S_OK
CASE stgmed.tymed
OF TYMED_ISTORAGE
thisStorage &= (stgmed.u.pstg)
cdFilename = 'c:\sample.msg'
IF wcdFilename.Init(cdFilename)
hr = StgCreateStorageEx(wcdFilename.GetWideStr(), |

BOR(BOR(BOR(STGM_DIRECT,STGM_CREATE),STGM_READWRITE),STGM_SHARE_EXCLUSIVE), |

STGFMT_STORAGE,0,0,0,ADDRESS(_ISTORAGE),pObjectOpen)
IF hr = S_OK
myStorage &= (pObjectOpen)
hr = thisStorage.CopyTo(0,0,0,myStorage)
myStorage.Release()
END
END
--
Regards,
Randy


"Dmitry Streblechenko" wrote:


Similar Threads:

1.drag & drop outlook contacts

2.Importing Contacts from Outlook via Drag and Drop

I can currently handle the operator dragging messages, contacts, calendar
appointments etc. from Outlook to my application. When something is dropped
onto my application I create a file containing the contents of whats being
dropped. I would like to extend my application to recognise whats being
dropped so that I can create my own contact records. Is the format of the
data being dropped publicly available and if so where? Alternatively, are
there any articles available on the web that explain how to do this?


3.Outlook 2002 - Contacts drag and drop to Inbox not working

When a Contact name is dragged to the Inbox, the contact 
is moved to the Inbox instead of a new message being 
created.  Help!

4.Outlook contact is deleted when dragged and dropped to folder

Here's a strange one... 

Typically, a user can select one or more contacts and then drag&drop them 
onto a mail folder (or the mail button in the Navigation pane, in the case of 
Outloom 2003, which we are using here) in order to create a new mail message 
to these person(s) as recipients. 

I can do this without issue at this facility, however there are two recently 
converted users from the Groupwise environment who lose their Contact when 
they attempt this. The contact is gone, not in DELETED ITEMS, Not in the 
MAILBOX and nowhere to be found in the information store. I've attempted 
using the RIGHT-MOUSE button click and drag technique to see if they have 
choices (as I do). But these two users do not have the shortcut menu. Their 
Contact simply disappear in this case as well.

Has anyone come across anything similar to this situation elsewhere? There 
are 14 pilot users here who have been migrated however these appear to be the 
only two affected by it.

Thanks in advance!

-BB.
-- 
MCSE

5.Outlook contacts should utilize drag n' drop.

When you create a new message you should be able to select any number of 
contacts and simply drop them into the message "to" "cc" or "bcc" fields.  
Also, when you create a new Contact Group you should just be able to drag new 
members into it (both when it's open and when it's just sitting in the 
folder).

6. Drag & Drop Outlook Contacts

7. Drag and drop a contact from Outlook into my App

8. Drag&Drop event word//link dropped picture



Return to MS OFFICE OUTLOOK

 

Who is online

Users browsing this forum: No registered users and 9 guest