OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Urgent Help: Alex: with Corel VBA and Visual basic program (http://forum.oberonplace.com/showthread.php?t=1890)

amollondhe 23-11-2006 02:00

Urgent Help: Alex: with Corel VBA and Visual basic program
 
Hi!!

I have a Visual basic program which invokes the corel macro.

I just wanted to know is it possible to write a function which returns some string value back to the Calling visual basic program.

e.g

Visual basic program

dim abd as String

abd="call abc corel macro".

Corel macro

public function abc() as String

Activedocument.getsize dbla,dblb
dblTotlssize = dbla + dblb

returm dbltotalsize ''this has to be returned to the visual basic program.


Any help is appriciated

Thank You
Amol

Alex 23-11-2006 08:57

Yes, it's possible. In VB/VBA you just assign the return value to the function name:

Code:

Public Function abc() As String
  ' Do something
  abc = "Some String"
End Function

In VB.NET you can either do the same or use the Return statement as you showed above.


All times are GMT -5. The time now is 23:35.

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