I'm wanting to get the file summary from a selected file and put it into seperate strings, title and so on.
Cheers..
Printable View
I'm wanting to get the file summary from a selected file and put it into seperate strings, title and so on.
Cheers..
What kind of file and what do you mean by "file summary"?
A file that you have saved on your hard drive. Like, "C:\test.txt". If you right click this file and select Summary (win 2k >) then you have the title, version etc..
This is the data that I'm wanting to get from files.
Oh...you want the property page. Try something like thisQuote:
Originally Posted by Chrispybee
VB Code:
Option Explicit Private Type SHELLEXECUTEINFO cbSize As Long fMask As Long hwnd As Long lpVerb As String lpFile As String lpParameters As String lpDirectory As String nShow As Long hInstApp As Long lpIDList As Long 'Optional parameter lpClass As String 'Optional parameter hkeyClass As Long 'Optional parameter dwHotKey As Long 'Optional parameter hIcon As Long 'Optional parameter hProcess As Long 'Optional parameter End Type Private Const SEE_MASK_INVOKEIDLIST = &HC Private Const SEE_MASK_NOCLOSEPROCESS = &H40 Private Const SEE_MASK_FLAG_NO_UI = &H400 Private Declare Function ShellExecuteEx Lib "shell32.dll" _ (SEI As SHELLEXECUTEINFO) As Long Private Sub ShowProperties(filename As String, OwnerhWnd As Long) 'open a file properties property page for 'specified file if return value Dim SEI As SHELLEXECUTEINFO 'Fill in the SHELLEXECUTEINFO structure With SEI .cbSize = Len(SEI) .fMask = SEE_MASK_NOCLOSEPROCESS Or _ SEE_MASK_INVOKEIDLIST Or _ SEE_MASK_FLAG_NO_UI .hwnd = OwnerhWnd .lpVerb = "properties" .lpFile = filename .lpParameters = vbNullChar .lpDirectory = vbNullChar .nShow = 0 .hInstApp = 0 .lpIDList = 0 End With 'call the API to display the property sheet Call ShellExecuteEx(SEI) End Sub 'Usage: Place the full path and file name in the text box Private Sub Command1_Click() Call ShowProperties((Text1.Text), Me.hwnd) End Sub
Sorry, maybe I didn't make myself clear. I've done this but it's not what I want. This will open the property page where all I want to do, is to say. I want the Title (from the summary page) from C:\test.txt in strTitleSummary.
I hope that this makes sense. I've tried using FSO and file1 but no joy. I do fell that this is an API call I may have to make but I dont know what it would be??
Please help.. :confused:
Thanks manavo11 for the reply. I cannot make head nor tail of this post. It looks like this is for vb.net and I've not had any experience with vb.net or c++
Please could explain how this could be used in Visual Basic 6?
Unfortunatelly, I couldn't get much either... I posted hoping that you would... :(
I need to use the function stgOpenStorageEX that I've found on MSDN. How would I format the below into VB format?
HRESULT StgOpenStorageEx(
const WCHAR* pwcsName,
DWORD grfMode,
STGFMT stgfmt,
DWORD grfAttrs,
STGOPTIONS* pStgOptions,
void* reserved2,
REFIID riid,
void** ppObjectOpen
);
I've found the source code I need to perform the required task, the only problem is that it's in Delphi!! Cannot find any VB6 source code at all!!
Here is the link http://www.delphi-central.com/tutori...mary_Info.aspx
Please can someone help me rewrite this to VB??
Thanks
I'm trying to rewrite the Delphi code from the above website but having difficulties..
I'm trying to put thisbut getting "User -Defined Type Not Defined"VB Code:
Public Declare Sub FmtIdToPropStgName Lib "iprop.dll" (ByRef pfmtid As FMTID, ByVal oszName As String)
I dont know where to get the FMTID from?
Any Ideas?? I think that I'm putting the correct API calls into my code but no joy!
Delphi has built in support for the Windows API, but in VB 6 you need to declare all the functions and UDT's your self. A user defined type is the equivalent of a record in Delphi.
The best I could find on FMTID is this:
http://msdn.microsoft.com/library/de...n_istorage.asp
I don't rewally understnad it though, so hopefully someone else will be able to help you convert it to something you can use in VB.
Thanks Visual App!! I've been trying to understand how I can declare the FMTID.
If anyone else can help me, that would be great!! I'm struggling here a bit and new to writing API stuff!!
If you have a look at the Delphi code, it has a few functions that I cannot find by either Internet Search or Using API Viewer.
This is the delphi code that i've foundCode:IPropertySetStorage
I have been able to find this fine and put it into my Module. The issue that I'm having is finding the IPropertySetStorage, IPropertyStorage, TPropVariant, TPropSpec & IStorage.Code:function StgOpenStorageEx (
const pwcsName : POleStr; //Pointer to the path of the
//file containing storage object
grfMode : LongInt; //Specifies the access mode for the object
stgfmt : DWORD; //Specifies the storage file format
grfAttrs : DWORD; //Reserved; must be zero
pStgOptions : Pointer; //Address of STGOPTIONS pointer
reserved2 : Pointer; //Reserved; must be zero
riid : PGUID; //Specifies the GUID of the interface pointer
out stgOpen : //Address of an interface pointer
IStorage ) : HResult; stdcall; external 'ole32.dll';
Please help as I cannot find a VB example on how to do this and would be great to be able to get this information.
Many thanks for all your help!
I am starting to cry!! Please could someone help me. I may be going around this the wrong way. :@(
OK 2 yrs later, any know how to access the StgOpenStorageEx from OLE32.dll using VB6? I can't find any good wrappers.