Why is my reference to an object instance destroyed

Hub van de Laar 0 Reputation points
2023-02-20T15:44:01.0133333+00:00

I'm using a extensive Word macro for years now. I'm trying to convert this to VB VSTO, but the object model gives lots of problems.

  • There are no 'Default properties' defined: Using fi. "Selection.Style = "Normal"' fails.
  • The properties are not shown at the drop down and you have to gues the property-name icq. "NameLocal".
  • The most severe one is creating an instance of 'Word.Shape' named 'DiaShape', and then defining another 'Word.Shape' with "Dim GrayBox As Word.Shape", immediately corrupts reference to the 'DiaShape'.
Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
883 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,738 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,992 questions
Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
227 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.