-
FlexPro
- Auf einen Blick
- Features & Optionen
- Einsatzgebiete
- Alle Vorteile
- Neu in FlexPro 2021
- FlexPro gratis testen
- FlexPro View OEM Freeware
- Kaufberatung
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Produkte
- News
- Support
- Unternehmen
- Jobs
- Kontakt
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
Add a diagram to a document with VBA
Home > Community > Automation and VBA > Add a diagram to a document with VBA
- Dieses Thema hat 2 Antworten sowie 2 Teilnehmer und wurde zuletzt vor vor 18 Jahren, 10 Monaten von Nicolas Beaupré aktualisiert.
-
AutorBeiträge
-
Januar 11, 2006 um 6:39 am Uhr #12425Nicolas BeaupréMitglied
Hi,
I can read some properties of a page in VBA, such as the shape count, but I can’t add a 2DDiagramm to the page of the document.Here is my code :
Dim obj As DocObject Set obj = ActiveDatabase.RootFolder.Object("diag", fpObjectType2DDiagram) 'obj is the DocObject With ActiveDatabase.RootFolder.Object("doc", fpObjectTypeDocument) .Pages(1).AddDocObject(fpObjectType2DDiagram, 0, 0, 10, 10, "diag") .Pages(1).AddRectangle(20,20,30,30) End With
The compiler talks about a syntax error, a ‘=’ would be required at the end of the lines.
Any luck that someone can help me ? Thanks
Januar 11, 2006 um 6:39 am Uhr #8106Nicolas BeaupréMitgliedHi,
I can read some properties of a page in VBA, such as the shape count, but I can’t add a 2DDiagramm to the page of the document.Here is my code :
Dim obj As DocObject Set obj = ActiveDatabase.RootFolder.Object("diag", fpObjectType2DDiagram) 'obj is the DocObject With ActiveDatabase.RootFolder.Object("doc", fpObjectTypeDocument) .Pages(1).AddDocObject(fpObjectType2DDiagram, 0, 0, 10, 10, "diag") .Pages(1).AddRectangle(20,20,30,30) End With
The compiler talks about a syntax error, a ‘=’ would be required at the end of the lines.
Any luck that someone can help me ? Thanks
Januar 11, 2006 um 6:19 pm Uhr #8703Bernhard KantzTeilnehmerIn VBA you have to remove the round brackets if you don’t use a assignment:
Dim oDiagram As Diagram2D ActiveDatabase.RootFolder.Add "Diagram", fpObjectType2DDiagram Set oDiagram = ActiveDatabase.RootFolder.Add("Diagram", fpObjectType2DDiagram)
The Top value and the Bottom[/B] value of the AddDocObject and the AddRectangle Property should be negative:
With ActiveDatabase.RootFolder.Object("doc", fpObjectTypeDocument) .Pages(1).AddDocObject fpObjectType2DDiagram, 0, 0, 100, -100, "diag" .Pages(1).AddRectangle 20, -20, 30, -30 End With
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.