OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > Corel Photo-Paint VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 23-09-2004, 08:41
Michael Cervantes
Guest
 
Posts: n/a
Default Disabling Delay Load VBA programatically

Is there any way to disable "Delay Load VBA" programatically.

I did have a problem while pasting, disabling this option solve the problem, but I will like to do it programatically.

Thanks and best regards
Reply With Quote
  #2  
Old 23-09-2004, 10:46
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: Disabling Delay Load VBA programatically

Michael,

You need to fiddle with registry. Here is the explanation of the key you need to change: http://www.oberonplace.com/forum/vie...hp?p=2268#2268
Reply With Quote
  #3  
Old 24-09-2004, 13:19
Michael Cervantes
Guest
 
Posts: n/a
Default Thanks Alex

Thanks Alex. It will help a great deal.

Best regards
Reply With Quote
  #4  
Old 24-09-2004, 17:28
Michael Cervantes
Guest
 
Posts: n/a
Default That register isn't on PhotoPaint

There is not Application Preference Register under Corel Photo Paint.

What else?

Best regards
Reply With Quote
  #5  
Old 24-09-2004, 17:42
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: That register isn't on PhotoPaint

Hmm, you are right. Photo-Paint doesn't keep its settings in registry. In fact, they are in the INI file in the workspace folder:

Code:
C:\Documents and Settings\<UserName>\Application Data\Corel\Graphics12\User Workspace\Corel PHOTO-PAINT12\_default\CorelPP.ini
This file has a bunch of options, but the one you are looking for is under [PREFERENCES] section in "DelayLoad" key:

Code:
...
[PREFERENCES]
...
DelayLoad=1
...
Setting this value to 0 will make VBA launch with Photo-Paint.

You can use Windows API function WritePrivateProfileString string to set this value directly:

Code:
Private Declare Function WritePrivateProfileString Lib "kernel32" _
        Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, _
        ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Long

Sub ForceVBALoad()
    Dim INIFile As String
    INIFile = "C:\Documents and Settings\michael\Application Data\Corel\Graphics12\User Workspace\Corel PHOTO-PAINT12\_default\CorelPP.ini"
    WritePrivateProfileString "PREFERENCES", "DelayLoad", "0", INIFile
End Sub
I hope this helps
Reply With Quote
  #6  
Old 24-09-2004, 21:32
Michael Cervantes
Guest
 
Posts: n/a
Default it works partially

It works fine changing the Delay value in the INI file, but it doesn't initialize VBA until PP is closed and reopened.

It isn't there another way to initialize VBA after PP is open?

Best regards
Reply With Quote
  #7  
Old 25-09-2004, 00:55
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: it works partially

Unfortunately no. In CorelDRAW there is InitializeVBA method but PHOTO-PAINT doesn't have one (yet).
Reply With Quote
  #8  
Old 25-09-2004, 04:14
Michael Cervantes
Guest
 
Posts: n/a
Default Please place it in the list

Alex, please make a checkmark for version 13 or for next SP if possible.

Thanks a lot, and best regards
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
delete vba project from cdr file hotairballoon CorelDRAW/Corel DESIGNER VBA 1 18-05-2005 10:08
CD 10, VBA not returning true outline width Webster CorelDRAW/Corel DESIGNER VBA 1 24-11-2004 18:09
Detect if VBA is installed (an answer and a question) reanan CorelDRAW/Corel DESIGNER VBA 3 04-12-2002 15:35


All times are GMT -5. The time now is 07:10.


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