OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 27-11-2016, 11:09
FaneDuru FaneDuru is offline
Join Date: May 2012
Posts: 35
Question How to use foreach (in C#) to iterate through Documents collection?

How can enumerate each (open) document from Documents Collection using C#?
I try something like that, but the line containing 'corel.Documents' is red:
using corel = Corel.Interop.VGCore;
 namespace DockerTest
     public partial class DockerUI : UserControl
        private corel.Application corelApp;
        public DockerUI(corel.Application app)
            this.corelApp = app;
        private void Button_Click(object sender, RoutedEventArgs e)
              foreach (corel.Document d in corel.Documents) //problem...
I use Mcrosoft Visual Studio 13 and it sais: 'Corel.Interop.VGCore.Documents' is a 'type', which is not valid in the given context.

How to make it 'understand' that corel.Documents is a collection...?

Thanks in advance!
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
X7 VBA and Controls Collection DebG Macros/Add-ons 0 23-05-2014 16:39
::ForEach:: macro wOxxOm CorelDRAW/Corel DESIGNER VBA 2 08-12-2010 15:12
Same Macro to all documents Manuel CorelDRAW/Corel DESIGNER VBA 5 10-05-2007 15:30
Font Collection Booker CorelDRAW/Corel DESIGNER VBA 1 18-05-2006 11:05
draw 11 export collection to psd xombie Code Critique 5 23-11-2005 12:02

All times are GMT -5. The time now is 04:57.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com