Shape property "decorative" not in VSTO? - powerpoint

I program PowerPoint add-ins both in VBA and in VSTO. In VBA I can use shape.Decorative to check, if a shape is decorative - and therefore does not need an alternative text. In VSTO however there is no such property.
I'm using Visual Studio 2022, the reference to PowerPoint is set to version 15.0.0.0.0 - but I can't see where I could change that. Am I using the wrong template?
I'm grateful for any tips how to get to that attribute. Thanks in advance, Sabina

The PowerPoint object model provides the Shape.Decorative property which sets or returns the decorative flag for the specified object. So, it doesn't matter whether it is a VSTO add-ins or VBA macro. The PowerPoint object model is common for all programming languages. In this situation you can:
Use a newer PIA to get access to the property (with intellisense suggestions).
Use the late-binding technology to invoke the property programmatically even when it is not available in PIAs. The Type.InvokeMember method invokes a specific member of the current Type.

Related

What is msstdfmt.dll?

The file msstdfmt.dll is I believe supplied with Visual Basic 6 and is sometimes a dependency for deployment.
The copy on my PC includes the helpstring
Microsoft Data Formatting Object Library 6.0 (SP6)
which is not very informative.
What is this DLL for? What are the key functionalities that it provides?
According to Microsoft documentation:
The Microsoft Standard Data Formatting Object Library is required for
controls that implement a DataFormat property. An Application Error
occurs when a control makes an attempt to use the DataFormat property
and the Microsoft Standard Data Formatting Object Library is not
registered. Controls that implement a DataFormat property include, but
are not limited to, the following:
CheckBox, ComboBox, Image, Label, ListBox, PictureBox, TextBox,
ImageCombo, MonthView, DTPicker, Calendar, DataCombo, DataList,
DBCombo, DBList, MaskEdBox, RichTextBox.
It is used pretty extensively for data formatting.
It gets used implicitly with many databound controls and when you create databound UserControls or datasource UserControls and Classes. Instances of the StdDataFormat object it provides can also be used explicitly, either for direct use in code or even assigned to an ADO Field object's DataFormat property.
It is a pretty fundamental library for any VB6 program that is not written in "Let's pretend we are writing QBasic" i.e. Dark World scripting mode. Egad, you may as well be using stone knives and bearskins (a.k.a. Python).

Custom property pages not titled in Outlook 2003

I am implementing a custom Outlook Property page in C++ as an ActiveX control as per this article.
Basically, I have noticed that when passing an initialized object (my ActiveX object) to the 'raw_add' method on the property pages obtained within the namespace event 'OpetionsPagesAdd', the second parameter (the property page tab title) is ignored in Outlook 2003. In 2007 and 2010 my code works absolutely fine, only in 2003 does that second parameter seem to be ignored.
I'm sure I have come across articles in the past describing this as a known bug in Outlook 2003, but I was wandering if anyone had found a way around the issue? I found this article describing the same issue, and the resolution, but that is for C#, and I can't for the life of me see how to port his 'fix' to C++.
I ended up raising a support case with Microsoft for this issue, and it is a bug in Outlook 2003. The way around it is to derive from public IDispatchImpl and define the caption property in the prop map:
( PROP_ENTRY_TYPE("Caption", DISPID_CAPTION, CLSID_PropPage, VT_BSTR)
Then implement the put_caption and get_caption methods and it should work.

Programatically configure Office 2010 Word Ribbon via VBA

Is it possible to configure a Ribbon (e.g. adding a tab etc.) in Office 2010 programatically via VBA? I.e. by writing VBScript code in a macro.
Br. Morten
You can manipulate a Ribbon tab and its controls using VBA, but you cannot create one. Not with the Object Model anyway. The best you could do - somehow - is to get some kind of OPC dll (like an ActiveX component) that handles opening/relationships/closing of OPC documents (like .docx documents) and old school MSXML for creating a ribbon definition and adding it to the package.
Have a look at this blog post for Excel
http://www.xtremevbtalk.com/showthread.php?t=265636
and this one for Word
http://www.wordarticles.com/Shorts/RibbonVBA/RibbonVBADemo.htm
If your UI is static, i.e. you don't need to programatically change the behavior of, or add/remove UI elements on the fly, you can define a customUI within a macro-enabled template. You can use your VBA functions as call-backs for the UI elements defined in the XML.
Have a look at this guide. In a nutshell, you define a customUI\customUI14.xml file within the .dotm archive. This XML describes your custom ribbon elements using this schema.
This definitely works for Word templates (.dotm files). I think a similar approach works for any OOXML format.

What ListBox like control is used in Collections Editor of Visual Studio

I need to create a from which uses the same ListBox as the one from Collection Editor of Visual Studio (The ListBox under the Members label). Please, explain exactly which WinForms control is this and which of its properties are set?
You can see the control I am asking about under the Members: label of every collection editor form in design time of Visual Studio.
Thank you.
Hopefully this can get you started. There's other (probably better...) samples out there, but this is a basic starter which can help you get the concept:
http://msdn.microsoft.com/en-us/library/9zky1t4k%28VS.90%29.aspx
Quote:
This example shows how to create a
control named ContactCollectionEditor
that implements a custom collection
editor. The example shows how to
specify the exact type of the object
that a page developer can add to the
control's collection property when
using a custom collection editor. You
associate a collection editor with a
collection property (or the type of
the property) by applying the
EditorAttribute to the collection
property of the control.

Inject Open XML into an Open PowerPoint Presentation

I'm looking for a way to inject PresentationML and/or DrawingML into an open PowerPoint 2007/2010 presentation using the Open XML SDK or just System.IO.Packaging. There is an article on doing this with Word, but in that example it is using the Range.XML routine in Word's object model, which I cannot find an equivalant for in PowerPoint's object model.
The reason I'm looking to do this is if I have an item on it that the PowerPoint client does not support editing of but that Open XML does (and as a result, PowerPoint will display it). I want to set this myself via a managed-addin (VSTO) on the open presentation. An example would be the underline of text (not that I'm looking for this, but it is an example) - in PowerPoint, you cannot make the underline of text a picture <a:blip/>, but in Open XML you can.
Does anyone know how to do this?
I am using both OpenXML SDK 2 and the Object Model to process presentations.
What I do, simplistic as it sounds, is to save the presentation, close it, perform all the XML modifications I need using OpenXML SDK, and then load the presentation back and continue with the Object Model.
Nope, according to Microsoft support: http://www.ureader.com/msg/10972430.aspx

Resources