msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

HTML OLE drag and drop from vb to word

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE
Author Message
Brian



Joined: 04 Oct 2007
Posts: 1

PostPosted: Tue Dec 21, 2004 11:38 am    Post subject: HTML OLE drag and drop from vb to word Reply with quote

Hi there,


I'm trying to create a program that allows drag and drop from VB into
word. I can get it working with simple text, but I need to be able to
effectively drag & drop a table. To do this, I assumed that I would be
able to create some html & give that to the DataObject when I start my
drag. However, when I do that, word seems to accept the drag as valid
(i.e. the cursor is correct), but when I release the mouse, nothing
happens.


Here's the code:


Private Sub TreeView1_OLEStartDrag(Data As MSComctlLib.DataObject,
AllowedEffects As Long)
Dim html As String
Dim byteData() As Byte
Dim temp As Long
Dim CF_HTML As Integer


html = "this is an html test"
byteData = html
temp = RegisterClipboardFormat("HTML Format")
CF_HTML = &H8000 Or (temp And &HFFFF&)
Data.SetData byteData, CF_HTML
End Sub


I'm using VB6 & OfficeXP. Iv'e searched the news groups & found some
examples, but they don't seem to work in this scenario. Any
suggestions appreciated.


Thanks in advance,
Brian.

Archived from group: microsoft>public>vb>ole
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group