ole

Delphi OLE - How to avoid errors like "The requested member of the collection does not exist"?

Hi, I'm automating Word with Delphi, but some times I got an error message: The requested member of the collection does not exist It seems that the Item member of the Styles collection class does not always exist and some times causes the above mentioned error. My workaround is to catch the exception and skip it, but is there an...

PasteSpecial using Ole,PowerPoint,Delphi

How do you use PasteSpecial in Delphi to paste into an Ole PowerPoint. I have rtf data i want to paste into powerpoint and I need to use PasteSpecial. However I cannot find documentation on how to fill out the parameters it needs. ...

OLE Component viewer find out it's id

Hi I'm trying to run an app thats designed for windows using wine. It's an reimplementation of the windows api. I'm getting these OLE errors so I was wondering if there's a way I can find out what's missing. err:ole:ITypeInfo_fnInvoke did not find member id -518, flags 0x4! err:ole:ITypeInfo_fnInvoke did not find member id -517, flags ...

Context menu disappears with Word automation

When I am editing a Word document in an OleContainer (inplace) and I switch to another Word document and then I switch back, I cannot use my rightmouse button anymore. The context menu will not show up. This happens on Word 2000, not on Word 2007 (I don't know about other versions). How can I get rid of this behaviour? How to reproduc...

Powerpoint displays a "can't start the application" error when an Excel Chart object is embedded in it

This is a very common problem when Excel Worksheet or Chart is embedded into Word or Powerpoint. I am seeing this problem in both Word and Powerpoint and the reason it seems is the COM addin attached to Excel. The COM addin is written in C# (.NET). See the attached images for error dialogs. I debugged the addin and found a very strange ...

Pass object from webserver to client

I developed a C# web application that calls a web-service which returns a base64 encoded array (PDF file). I then convert that array into a UCOMIStream object (I know it is obsolete, but the DLL that I am using requires it as a parameter). I use the following code to do the conversion which works perfectly. I can pass this object to t...

Embedded Office Application - How to know whether the app is running or the object is embedded

I am adding an Excel Worksheet object inside Word. Excel has a COM addin attached to it. Any idea how one can know whether Excel is running independently or as an embedded object? The COM Addin attached to Excel loads when the embedded Excel object is activated (double-clicked) inside Word. I am looking for some kind of a property or a ...

How do I deploy a utility with ocx dependency to a test machine without registering the ocx?

I have a test utility that depends upon an ocx file that is installed/registered on my development machine. We'd like to run this tool on a test machine without polluting the machine with any unnecessary files. Nothing should be installed except the target machine software. Running the tool on a network drive or from a stand-alone dir...

Delphi 7 and Excel 2007 Open File Error

I am having difficulty opening a EXCEL 2007 in Delphi 7 It works for Office 2003 and below but the wonderful people at microsoft have sent an update or something and the delphi app fell over just earlier this month. oE := GetActiveOleObject('Excel.Application'); oE.Workbooks.Open(Filename:=sFilename, UpdateLinks:=false, ReadOnly:=tr...

Programmatically Save an Excel File Using OLE

How do you programmatically save an excel workbook using OLE and C++ Builder? I'm guessing it might be something like: Variant excel = Variant::CreateObject("Excel.Application"); excel.OleProcedure("Save"); // but how might you specify the file name ...

Error DV_E_FORMATETC when asking for CFSTR_PRINTERGROUP - Windows 7

WI have a windows shell extension which adds menu items to the printer menu when the printer is right-clicked. The code works fine in Windows 2000, XP, Vista, but in Windows 7 the call to GetData() fails with DV_E_FORMATETC. I've found various threads regarding this but they all appear to be VB/asp related. The FORMATETC and STGMEDIUM st...

How to pass string indexes for OleVariant

Hi I'm converting the following example code to Delphi: http://msdn.microsoft.com/en-us/library/bb176406%28v=office.12%29.aspx My code is something like: var vTable, vRow: OleVariant; begin .... while vTable.EndOfTable = False do begin vRow := vTable.GetNextRow; sEmail := vRow['Email1Address']; ShowMessage(sEmail)...

The difference between using an OLE Object and an Attachment in Access 2007?

I'm learning Access 2007, and among the list of data types are the OLE Object and the Attachment. The text has this to say about Attachments: You can use attachments to store several files, and even different types of files, in a single field. The Attachment field is new for Access 2007 and stores data files more efficient...

How to implement Outlook Express alike address field control

Hi All, I was thinking about inserting some object (button, panel or static text) into textctrl, like Outlook Express does this. You can see from a pic "group1" is an object, you can double click on it, when you delete it, it gets deleted the whole text not just a part of it. I made some research and this text field is just a sim...

How to extract the contents of an OLE container?

I need to break open a MS Word file (.doc) and extract its constituent files ('[1]CompObj', 'WordDocument' etc). Something like 7-zip can be used to do this manually but I need to do this programatically. I've gathered that a Word document is an OLE container (hence why 7-zip can be used to view its contents) but I can't work out how to...

Missing _NewEnum in Outlook _Items interface

Hi, I'm re-implementing part of the OLE automation code in our in-house scripting language. I've written a piece of code that reads ITypeInfo and caches its members for every interface pointer that's used in a script. I use the cached info to convert names into dispids for calls to Invoke and for parameter count checking. We also imp...

paste with delphi in ole automation

i want paste in delphi from richedit to word application i used Following code but Twice paste data in word (duplicate) WordApp := GetActiveOleObject('Word.Application'); WordApp.Visible := True; Wordapp.documents.open('C:\Doc1.docx'); Richedit.Text := 'test text'; Richedit.SelectAll; Richedit.CopyToClipboard; WordApp.Acti...

IOleInPlaceSiteWindowless::AdjustRect not working?

I am using IOleInPlaceSiteWindowless::AdjustRect to properly capture and release the mouse in a windowless ActiveX control hosted in IE: LRESULT CD3DControl::OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) { CRect rc(CPoint(lParam), CSize(0, 0)); HRESULT hr = m_spInPlaceSite->AdjustRect(rc); ...

Can't insert newline in msword form field using Powebuilder OLE

Hi, I have an application written in Powerbuilder 11.5 that automatically fills in form fields of a Word document (MS Word 2003). The Word document is protected so only the form fields can be altered. In the code below you can see I use char(10) + char(13) to insert a newline, however in the saved document all I see is 2 little squar...

how to connect to an open window of internet explorer using c#?

Can you use COM/OLE in a C# program to connect to a running instances of internet explorer? Ideally I'd like to find the URLs of all webpages open in IE. ...