-
FlexPro
- At a Glance
- Features & Options
- Applications
- All Advantages
- What’s New in FlexPro 2021
- Try FlexPro For Free
- FlexPro View OEM Freeware
- Buying Guide
- Login
- Language
-
-
-
- +49 6894 929600
- infoweisang.com
- Google Maps
- Products
- News
- Support
- Company
- Contact
- Login
- Language
-
-
-
- +49 6894 929600
- infoweisang.com
- Google Maps
Home > Community > Automation and VBA > Copying markers from a diagram to a document > Reply To: Copying markers from a diagram to a document
![Krista Tweed](https://www.weisang.com/wp-content/uploads/2016/09/default_avatar.jpg)
I am writting a VBA application that needs to copy the Markers text from a 2D-Diagram to the 2D-Diagram included in a Document.
I have a 2D-Diagram with two curves and a Document which contains a copy of the 2D-Diagram. I set several markers in the 2D-Diagram and then I run my macro to copy only some of the markers into the document.
The macro is able to copy the markers with X and Y coordinates but is unable to change the text of the marker.
Here is a part of the macro :
——————————————
Dim Diagramme As Diagram2D
Dim Doc As Document
Dim NbMarkers As Integer
‘Activate 2D-Diagram object
ActiveDatabase.RootFolder.Object (“2D-Diagram.2D”)
Set Diagramme = ActiveDatabase.ActiveObject
‘get NbMarkers in the 2D-Diagram object
NbMarkers = ActiveDatabase.ActiveObject.Markers.Count
‘Activate the Document Object
Windows(“CalculsDocument (Document)”).Activate
‘Activate the 2D-Diagram object in the document
ActiveDatabase.ActiveObject.Pages(1).Item(1).Select
Set Doc = ActiveDatabase.ActiveObject
‘Active cursors
Doc.CursorActive = True
‘Autocenter Off
Doc.ActiveCursor.Bounded = False
‘Place cursorX and cursorY in the document
Doc.ActiveCursor.PositionX = TabMarker(i, 0)
Doc.ActiveCursor.PositionY = TabMarker(i, 1)
‘Place marker in the document
Doc.ActiveCursor.PlaceMarker
‘Change the marker text
ActiveDatabase.ActiveObject.Markers.Item(1).Text=”O1″
—————————————————————————-
The last line ActiveDatabase.ActiveObject.Markers.Item(1).Text=”O1″ changes the marker text in the “2D-Diagram” but not in the document .
Is it possible to change the text of the markers only in the document and not in the original 2D-Diagram ?