I would like to know which functions I can use with RDCOMClient objects.
For example, to create an email we can use
OutApp <- COMCreate("Outlook.Application")
# create an email
outMail = OutApp$CreateItem(0)
Along with outMail[["subject"]], outMail[["HTMLbody"]] or outMail[["Attachments"]]$Add(filepath)
But how can I get a comprehensive list?
The RDCOMClient doc is out-of date and the functions listed such as getFuncs() and getElements() are not available in the package anymore. Using names() to try and find out what was under the hood gave me no result, and
install.packages("remotes")
remotes::install_github("omegahat/SWinTypeLibs")
gives an error as well. Any idea on how to check Outlook for objects?
If you have Outlook, Excel or Word installed then you can do the following ...
Press F11 to get to a Visual Basic Application (VBA) Integrated Development Environment (IDE).
On the menu bar go to Tools->References to prompt the References dialog box.
On the References dialog box, in the Available References checkbox list, page down until you find Microsoft Outlook Library (or similar), once found then check the checkbox and then press OK to confirm selection and dismiss dialog. This adds a reference to the Outlook type library to the current project.
With the Outlook type library referenced (see step (3)) one can now press F2 to show the Object Browser dialog box.
In the Object Browser dialog box, select the top left dropdown list which will probably say <All Libraries> . Change the dropdown so it says Outlook, this will scope the object browser to just the Outlook type library.
You can now browse all the objects in the Outlook type library. Select a class in the Classes pane on the left hand side and the class's methods will appear in the right hand side.
Enjoy!
I am not sure of a way to do this in R, but you should be able to do it in powershell.
I am still learning powershell, but this at the very least gets all the properties and methods of an object:
$ol = New-Object -ComObject Outlook.Application
$new_item = $ol.CreateItem(0)
$new_item | Get-Member
TypeName: System.__ComObject#{...}
Name MemberType Definition
---- ---------- --------
HTMLBody Property string HTMLBody () {get} {set}
Subject Property string Subject () {get} {set}
Attachments Property Attachments Attachments() {get}
There are a lot more than this but I'm actually transcribing from my other computer which has Outlook installed. The Get-Member works on more than just the application object so you can also see the members and properties accessible to the Outlook object itself or other COMS.
It also appears that the VBA resources may be helpful:
https://learn.microsoft.com/en-us/office/vba/api/outlook.application.createitem
Name
Value
Description
olAppointmentItem
1
An AppointmentItem object.
olContactItem
2
A ContactItem object.
olDistributionListItem
7
A DistListItem object.
olJournalItem
4
A JournalItem object.
....
...
...
And most importantly:
https://learn.microsoft.com/en-us/office/vba/api/outlook.mailitem
PROPERTIES
---------
Actions
AlternateRecipientAllowed
Application
Attachments
AutoForwarded
AutoResolvedWinner
BCC
BillingInformation
Body
BodyFormat
Categories
CC
...
This can somewhat easily be done for Outlook, because every outlook object has a class property.
If you have a given object of COMIDispatch class in R, and it is a reference to an Outlook object, you can use the function class() to retrieve its class and then check the OlObjectClass enumeration for what properties and methods that class has.
A short step by step example:
> # initialise the app
> Outlook_App <- RDCOMClient::COMCreate("Outlook.Application")
In order to find out what we can do with that object, we need to look up the reference. For that, we need its class.
> Outlook_App$class()
[1] 0
So we look up 0 in the OlObjectClass enumeration and find out it's an Application object. Its properties and methods are listed in the referenced link in the OlObjectClass enumeration: Application.
Here, we have access to the methods and properties. For the events, we would need the now defunct packages RDCOMEvents and/or RDCOMServer.
But we can try the method getNameSpace("MAPI") to access some other functionality. We know that we have to use the "MAPI" parameter from the method description linked above.
> Outlook_Namespace <- Outlook_App$getNameSpace("MAPI")
Now, the Namepace object has another class, for which we can look up the object definition and so on and so forth.
Unfortunately this does not work for Excel objects, since they do not have a class property, if anyone knows a solution please contact me.
Related
I am trying to automate my work in SAP using the Robot Framework with the SapGuiLibrary, but at the moment I’m having difficulties executing the Doubleclick Element command on a shell object.
After inspecting the object with Script Tracker I found the lines below:
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").setCurrentCell 2,"STRAS"
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectedRows = "2"
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").doubleClickCurrentCell
The command asks for 3 parameters:
Doubleclick Element element_id item_id column_id
So I put like this:
Doubleclick Element wnd[0]/usr/cntlGRID1/shellcont/shell 2 STRAS
But it dind't work as you can see below:
AttributeError: <unknown>.doubleClickItem
So what am I doing wrong?
I think it's a current limitation of SapGuiLibrary.
The keyword DoubleClick Element is only for double clicking an item in a Tree control of type "List" or "Column" (object GuiTree).
In your case, you want to double-click a cell in a Grid control (object GuiGridView), but SapGuiLibrary doesn't propose a keyword for that.
Either you file a bug at https://github.com/frankvanderkuur/robotframework-sapguilibrary/issues, or you do the correction yourself.
NB: if you're a developer, you may see all the limitations by comparing the SapGuiLibrary code and all possible SAP GUI Scripting objects and methods (use this direct link if the search hangs).
How do I find all the text modules used in an Adobe Form? Is there a table somewhat like TADIR where I could type in the Adobe Form name and the object names (text modules) for that form name will appear?
My answer regarding Smart Forms is perfectly valid for Adobe Forms too. Adobe Forms also have SO11 text elements hard-coded in the form FM code. The only difference is link between Adobe form FM and Adobe form INCLUDE: for some reason there is no link for them in the D010INC table.
However, as your intention is to find text elements of a single form, and not mass searching, you can find out the INCLUDE manually.
Find out Adobe form function module name. You can do this either manually (Test button in SFP tcode)
or via the FP_FUNCTION_MODULE_NAME FM. Resulting Adobe Form function module name should follow /1BCDWB/SM0000XXX pattern.
Open this FM in SE37 and go to function group code (GoTo->Main program). There you will find something like this and there get the name of main INCLUDE, which holds the code.
Then by forward navigation go to INCLUDE code and by simple Find of %textkey-name pattern you can observe all text elements which were utilized in the form.
I'm working on Odoo 10. When I click on the button, get mentioned error.
I want to convert a contact in partner so I need create a new line in another table with the values I put in the .create(vals).
The following links are some extracts of my code , hope you can help me.
my class : model.py
my view : model_view.xml
my error : server trace back
I don't understand your code at all. You inherit a model called test.res.partner and I don't know if you already created it. That may be the issue.
It could be also the fact that you may no be importing your model.py file if this module inherits another one that you have already created.
In general this message indicates that the method convert_prospect does not exist in the model test.res.partner.
But seeing how you write your view (like using xpath in a view that does not inherit from another one) you should rework your fundamentals.
Ah and don't call that prospect() at the end.
I am trying to use 'the' as the article for my object, but FB is simply ignoring it and is using 'a' instead.
When I run the object's url in FB's debugger I see all the info that's necessary. All the other properties are being used just fine.
Anyone have any idea why this is happening?
Object types cannot use "the", only "a/an". So if your determiner isn't showing when not using the object's title, that's why.
I have written a GUI extension which adds an additional tab to many of the Item views in the SDL Tridion CME (e.g. Component, Page and Schema etc.). I have also written some JavaScript which loads that tab directly if when the view is loaded with a tab name is specified in the URL.
The result is that if a page is loaded with the tab name added as follows:
http://localhost/WebUI/item.aspx?tcm=64#id=tcm:1-48-64&tab=InfoTab
Rather than the default of
http://localhost/WebUI/item.aspx?tcm=64#id=tcm:1-48-64
The Info Tab will be loaded on top, instead of the General Tab. This is performed with the following code snippet and works very well:
$evt.addEventHandler($display, "start", onDisplayStarted);
// This callback is called when any view has finished loading
function onDisplayStarted() {
$evt.removeEventHandler($display, "start", onDisplayStarted);
var tabname = $url.getHashParam("tab");
if (tabname != '') {
var tabControl = $controls.getControl($("#MasterTabControl"), "Tridion.Controls.TabControl");
tabControl.selectItem(tabname);
}
}
Now I would like to make a context menu item to open items and link to the tabs using my new functionality. My first thought was to construct the Item URL myself and simply open a new window in my execute method. So I looked at the default functionality in the standard Open.prototype_execute() functionality of the GUI. This is stored in the navigation.js file of the CME, and is performed by the Tridion.Cme.Commands.Open.prototype._execute method. The code is a lot more complicated than I had anticipated as it deals with shared items, and permissions etc.
Rather than just copying all of this code to my own function, I was wondering if there is a way to elegantly extend the existing Open.prototype_execute() function and append my “&tab=MyTab” to the $cme.Popups.OPEN_ITEM_OPTIONS.URL constant for my own functions.
Any advice would be greatly appreciated.
At the end the Open command uses $config.getEditorUrl(item_type) to get the url for the item view (item_type - $const.ItemType.COMPONENT, etc). There are no extension points for this part of the functionality, but you could always try to overwrite it on your own risk.