OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30-06-2005, 12:43
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default Quick Switcher

I wrote a macro for CD12 recently that does what I want the code below to do. However, my hard drive recently failed and I lost a lot of my custom macros. The code below doesnt work, but from looking at it you can quess what I want to do. How do I fix it?
Code:
Sub SwitchView()
    
    If ActiveDocument.ActiveWindow.ActiveView.Type = cdrEnhancedView Then
        ActiveDocument.ActiveWindow.ActiveView.Type = cdrSimpleWireframeView
    End If
    
    If ActiveDocument.ActiveWindow.ActiveView.Type = cdrSimpleWireframeView Then
        ActiveDocument.ActiveWindow.ActiveView.Type = cdrEnhancedView
    End If
End Sub
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #2  
Old 30-06-2005, 12:50
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default Duh!!!!!

fixed it with this little bit... Adding an "Exit Sub" in the If statement made all the difference. In my moment of clarity, I realised that the macro was running, but going so fast that I couldn't tell it was switching and then switching back again.
Code:
Sub SwitchView()
    
    If ActiveDocument.ActiveWindow.ActiveView.Type = cdrEnhancedView Then
        ActiveDocument.ActiveWindow.ActiveView.Type = cdrSimpleWireframeView
    Exit Sub
    End If
    
    If ActiveDocument.ActiveWindow.ActiveView.Type = cdrSimpleWireframeView Then
        ActiveDocument.ActiveWindow.ActiveView.Type = cdrEnhancedView
    Exit Sub
    End If
End Sub
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #3  
Old 30-06-2005, 14:47
Lev
Guest
 
Posts: n/a
Default

Here is my variant which I'm using for several years
Code:
Sub ToggleView()
with ActiveDocument.ActiveWindow.ActiveView
If .Type = cdrEnhancedView Then
.Type = cdrWireframeView
Else
.Type = cdrEnhancedView
End If
End Sub
Reply With Quote
  #4  
Old 24-08-2005, 13:44
petig
Guest
 
Posts: n/a
Default

Hmm... I had the same problem. I took two lines to the GlobalDocument_OpenDocument event:

ActiveDocument.ActiveWindow.ActiveView.Type = cdrSimpleWireframeView
ActiveDocument.ActiveWindow.ActiveView.Type = cdrEnhancedView

and than I took to the Ctrl + F12 shortcut the Toggle view command in Custimisation. Now I'm surprised, because this two line now isn't there, and the shortcut works...
Reply With Quote
Reply


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
quick export in vc++ andrej CorelDRAW/Corel DESIGNER VBA 2 11-07-2003 04:05


All times are GMT -5. The time now is 02:56.


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