Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

How to Access Properties of Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ahmad Jalil Qarshi - 29 Mar 2005 06:54 GMT
hi!

i have placed my own activex control into Word document using following
function.

CComVariant varClsType("Ascertia.AscertiaObj.1");
MSWord::InlineShapePtr MyObj =
m_pWordApp->Selection->InlineShapes->AddOLEObject(&varClsType);

Now my activex control has different get and set properties like Caption,
BKColor,MyData etc. I want to access and modify those properties using VBA
or prefferably VC++ code from within Word.

anybody there to give me a hand.
Thanks in advance.
Ahmad Jalil Qarshi
Alexander Nickolov - 29 Mar 2005 19:44 GMT
The name of the method suggests you are adding your control
as an OLE insertable object, not as a control. These are not
presumed to support Automation and are controlled by the
container (Word) directly. I don't know Word, so can't tell you
any specifics, but you may consider looking for a different way
of adding your object (or I may be wrong). Ask this question
in the office groups. For example:

microsoft.public.office.developer.automation

Signature

=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

> hi!
>
[quoted text clipped - 12 lines]
> Thanks in advance.
> Ahmad Jalil Qarshi
Ahmad Jalil Qarshi - 30 Mar 2005 08:18 GMT
Thanks Alexander!
you are right i didn't add my control as an activex control. now i have
added it using AddOLEControl. it return the InlineShapePtr which contains a
member OLEFormat. i used OLEFormat's GetObject function to return the
IDispatchPtr and so i accessed my Control's properties successfully.
Thanks again.
Ahmad Jalil Qarshi

> The name of the method suggests you are adding your control
> as an OLE insertable object, not as a control. These are not
[quoted text clipped - 30 lines]
> > Thanks in advance.
> > Ahmad Jalil Qarshi
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.