{System.__ComObject}

  • Thread starter Thread starter Ron Dahl
  • Start date Start date
R

Ron Dahl

In Word VBA the expression "ActiveDocument.Paragraphs(1).Style returns
"Heading 3"

In VB.Net the expression "appWord.ActiveDocument.Paragraphs(1).Style"
returns "{System.__ComObject} [System.__ComObject]: {System.__ComObject}"

How can I get vb.net to return "Heading 3" instead of "{System.__ComObject}
[System.__ComObject]: {System.__ComObject}".

Thanks in advance for any help.

Ron Dahl
 
Hi Ron,

When .NET objects need to interact with COM objects, they use "wrappers" and
sometimes when querying the type you get "System.__ComObject". To know the
actual type behing a __ComObject, use:

Microsoft.VisualBasic.Information.Typename(variable)

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
 
Ron Dahl said:
In Word VBA the expression "ActiveDocument.Paragraphs(1).Style returns
"Heading 3"

In VB.Net the expression "appWord.ActiveDocument.Paragraphs(1).Style"
returns "{System.__ComObject} [System.__ComObject]: {System.__ComObject}"

How can I get vb.net to return "Heading 3" instead of
"{System.__ComObject} [System.__ComObject]: {System.__ComObject}".

Use 'ActiveDocument.Paragraphs(1).Style.NameLocal' instead.
 
Back
Top