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 

How to save inserted object on disc?

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



Joined: 04 Oct 2007
Posts: 2

PostPosted: Wed Oct 13, 2004 1:33 pm    Post subject: How to save inserted object on disc? Reply with quote

Hi,
I am looking for a simple way in VB to get and save on local disc the content
of all inserted objects in a ms word document.
I'm using ms word 2002 sp-2.
I would be grateful for any help
Thank you

Archived from group: microsoft>public>vb>ole
Back to top
View user's profile Send private message
Pawel



Joined: 04 Oct 2007
Posts: 2

PostPosted: Mon Oct 18, 2004 5:08 am    Post subject: Re: How to save inserted object on disc? Reply with quote

For Word and Excel inserted objects I do something like the code below.
But what to do with other types of objects like PDF, TXT ?
Is there a way to be generic?


Dim ishape, myObj, pjClassType, tempDoc, o, obj
Dim tempFiles As New Collection
For Each ishape In ActiveDocument.InlineShapes
If ishape.OLEFormat.DisplayAsIcon Then
tempFile = tempFolder & "\pj_word_" & CStr(i)
pjClassType = ishape.OLEFormat.ClassType
If pjClassType = "Excel.Sheet.8" Then
tempFile = tempFile & ".xls"
ishape.OLEFormat.Open
Set myObj = ishape.OLEFormat.Object
myObj.SaveAs (tempFile)
tempFiles.Add (tempFile)
myObj.Application.Quit
Set myObj = Nothing
ElseIf pjClassType = "Word.Document.8" Then
tempFile = tempFile & ".doc"
Set tempDoc = ishape.OLEFormat.Object
tempDoc.SaveAs (tempFile)
tempFiles.Add (tempFile)
Set tempDoc = Nothing
End If
i = i + 1
End If
Next ishape
Back to top
View user's profile Send private message
tnguyen08



Joined: 04 Oct 2007
Posts: 1

PostPosted: Tue Nov 15, 2005 9:06 pm    Post subject: Re: How to save inserted object on disc? Reply with quote

Is there a way to get the original filename of embed file? The icon has
the filename on there. Thanks.

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Object within an Object Hello, I hope this is the right group to post to. I'm trying to have a VB6 application create an (Office10) object through late binding which opens an MDE database. The Access code will then create an (

OLE OBJECT Control Where i Find a OLE OBJECT CONTROL in VS.NET?

VB6 Object References I’m creating an application that will report dependency information for a given Visual Basic Project. The application simply reads the .vbp file, obtains the GUIDs, and looks to for confirmation that the resource has been registered. Th

OLE Object Control I want to know that where i could get the OLE control in VB.net.if any one knows please guid me. bye bye Damodar

shockwave object without oledrag Hi,I'm trying to find a way to give to a shockwave obj the oledrag and drop methods. Up to now I have worked around it putting a picture that when the form it's out of focus it just cover it.The only drawbacks are that you can drag a file without losing f
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