win32ole

Word Automation using WIN32OLE

I am trying to insert an image (jpg) in to a word document and the Selection.InlineShapes.AddPicture does not seem to be supported by win32old or I am doing something wrong. Has anyone had any luck inserting images. ...

Ruby win32ole - how to determine the OLE class type, whether the OLE class supports a method

I am using Ruby 1.8. Using the WIN32OLE module - 1) How do I determine the class name of an OLE object instance? 2) How can I tell whether an object instance supports a particular method? In an Outlook automation script, I am trying to delete the items in the 'Deleted Items' folder which are older than 21 days. For mail items, I want t...

Browse field

How can I choose a file from a file browse dialog (i.e., uploading a file from my PC) in a Ruby Selenium automation script? ...

Get COM object for embedded IE browser with ruby win32api

Alright this is a pretty complicated problem but it looks like the hard work has been done already by the autoit IE.au3 project. So now it just takes someone experienced with ruby and win32api, and possibly autoit as well to figure out how to translate a function written in IE.au3 to ruby. The end result is I want to use Watir with an em...

How do I disable exp/lib generation when building an exe?

I realize this is probably caused by some _dllexport() somewhere, not in my code but in some third-party piece. (Qt, Boost, OpenSG, ...) Is there a simple linker option to disable this? I've searched but not found anywhere. ...

Use Ruby to permanently (ie, in the registry) set environment variables?

On Windows, how can I use Ruby to permanently set an environment variable? I know I need to change the registry (through the win32ole module?) but I am a novice with regard to scripting the registry. I understand that I can say ENV['FOO'] = "c:\bar\baz" to set the environment variable FOO for the session. However, I am instead interes...

Creating an Excel list with Ruby

I'm generating an excel in ruby which each line represents the results of an nmap scan. An example of a line could look like that: ip, yes (because port is 22 open), no (because port 80 is not open), etc. I would like to be able to create a header line with a drop down list for each port that allow me to select if that port is open or ...

How can I automate an existing instance of Internet Explorer using Perl?

I am struggling to get control of an IE preview control which is 'Internet Explorer_Server' class on an external windows application with perl. Internet Explorer_Server is the class name of the window, I've found it with Spy++. and here’s my assertion code of it $className = Win32::GUI::GetClassName($window); if ($className eq "Inter...

Ruby: com object output parameter

I'm working with WIN32 COM Object from Ruby via win32ole library require "win32ole" #~loading com object o = WIN32OLE.new('{1A80830AF-4CA5-11D4-BC26-991045698E9C}') #~invoking "Process" method o.Process(parameter_1,parameter_2) "Process" method has two parameters: parameter_1 is input xml string and parameter_2 is output xml string ...

insert image in .doc using win32ole library of Ruby

Hi all, As the Title suggests, i am trying to find how to insert image in MS Word(.doc file) using ruby Win32Ole api. I have tried the function InsertFile of Range Object but it seems, it is only made for inserting other doc file in our file in question. Does anyone know anything related to this . It will very helpful. ...

Any standard guide for Ruby WIN32OLE API?

Hello all, I searched a lot on this but haven't yet got any standard or rather systematic guide for Win32Ole in Ruby. Ruby on windows by David is very good but I need a complete, systematic standard tutorial for WIN32OLE ruby APIs. Please suggest! Thanks Pradyumna ...

Internet Explorer COM automation: Converting numeric error code to string

I am writing some code for driving Internet Explorer from a Perl 5 program through Win32::OLE, and I am looking for ways to convert numeric status/error codes that are delivered back to the Perl program via events (such as NavigateError) into a somewhat more human-readable form. Is there some kind of library function that converts i.e....

COM types question

I have this vendor-supplied TLB file, which I've used to generate a Ruby proxy class. However, the TLB in question describes 6 interfaces and 3 classes: AcdAutomationServer (I) AcdAutomationServerClass (C) AcdEvent (I) AcdEventClass (C) AcdObject (I) AcdObjectClass (C) IAcdAutomationServer (I) IA...

How can I copy and paste a range of tables in Word?

EDIT: If you have an example in VBA, I'll take it. I'm just trying to understand how to use the Range object with the Tables collection to copy and paste multiple tables without looping. Put another way, how can I specify a range of 1..lastTable using the Tables collection? If I can see a working VBA example of this, I'll work on the VBA...

Ruby IE win32ole - how to get status code of a page?

Hello, how to get the status (200 OK, 404 NOT FOUND etc.) of the last page fetched by an IE instance? ...

Why doesn't the wdBorderVertical exist when using a range of cells instead of a selection?

FYI, I'm using Perl and Win32::OLE, but the error is a Word VBA one. Using Perl's Win32::OLE module, I'm trying to create a table in Word and format certain elements of it. I created the table (15 x 3) and successfully created a range object pointing to the cells from (2, 1) to (14, 3), i.e. all cells except the top and bottom rows. I ...

How to Execute/ShellExecuteEx/InvokeCommand ITEMIDLIST pointing to Shell objects ?

I'm building a kind of dock, and I struggle at finding how to save things like "Run", "Search", "Help", "Printers" and reopen them after that. I tried this : CComPtr<IShellFolder> pDF; SHGetDesktopFolder(&pDF); LPITEMIDLIST pidlPrintersAndFaxes=0; hr=pDF->ParseDisplayName(0, 0, L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3...

How do I set Excel formulas with Win32::OLE?

Hello, can anybody tell me, why the "...->{FormulaR1C1} = '=SUMME( "R[-3]C:R[-1]C" )';" doesn't work. In the Cell where should appear the result I get "#Wert!" ( maybe "Value" in English ). With the WENN(IF)-formula I get what I expect. #!C:\Perl\bin\perl.exe use warnings; use strict; use Win32::OLE qw; use Win32::OLE::Const 'Micro...

Possible to control Adobe Professional 9 through win32ole API?

Hi! As the title says.. Is it possible to control Adobe Professional 9 through the win32ole API, preferably by using Ruby scripts. I want to be able to open a PDF document and enable the extended commenting features allowing for commenting the file when opened in Adobe Reader, but I need to do it programmatically. ~ ToRd ...

Extract mail from Exchange and load into Mysql. Perl Win32::OLE or Perl Net::POP3, or try it in Ruby, or dabble in the, bletch, MS Access dark arts?

My problem is this: I need determine the timestamp of the first and last email sent from an Exchange account for every day that mail exists for. Also, for each day I need to rank the words that appear in each email so that I can report trend words for each day. I have two approaches to this I'm considering, and would welcome comments an...