Hello,
does anyone know how to export a textstring (including CR and LF) to the clipboard to paste this string in Word / Excel / AnyOtherProgram?
Actual I open a form wich displays the generated string and the user has to press CTRL-C (to copy). I want to send the string directly into the clipboardwithout this special form.
CR and LF are not the problem, this works fine.
Any ideas?
Best regards,
Wolfram
0
Comments
Clipboard.Clear
Clipboard.SetText CopyText
They work just fine in i.e. an automation controller.
<strong>Explore the following functions in Visual Basic:
Clipboard.Clear
Clipboard.SetText CopyText
They work just fine in i.e. an automation controller.</strong></font><hr /></blockquote><font size="2" face="Verdana, Arial">Thank you. But wich automation controller? I searched many, but didn't find the functions you said above.
I don't have VB. And I want to use this function at every Client. Do I need a VB runtime?
Best regards,
Wolfram
I have made a very simple ActiveX control, that you can include from within Navision. I could upload it to this site, or I could E-mail it to you.
Do you want it, or have you already solved the problem yourself?
Regards
Michael
please post it to the board. I think I am not the only one who would like a function like this.
If you don't have a manual or codesample ..., after I checked the ActiveX I will write it and send to you.
Thank you very much.
Best regards,
Wolfram
Just an idea.
- how can I import a OCX in a BLOB (I never tried it and didn't make any experiments, and actually have no idea how to do this)
- how can I check if a special OCX is installed before execution of a OCX?
(e.g. in a Report/Codeunit ... I have a global automation contoller defined. Now if I start the Codeunit I get a error message if the OCX is not installed; I have no chance to check the OCX)
- how can I export the OCX to the system and register it; since today I never ran external programs.
Maybe these are beginner questions, but how to check a OCX also a solution center didn't know.
Best regards,
Wolfram
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
txtPath := 'd:\path\myocx.ocx';
recCompanyInfo.GET;
recCompanyInfo."OCX Component".IMPORT(txtPath,TRUE);
recCompanyInfo.MODIFY;</pre><hr /></blockquote><font size="2" face="Verdana, Arial">This example presumes you have created a blob-field "OCX Component" in table 79 Company Information.
To check if OCX is installed:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">recOLEControl.SETRANGE(Name,'myOCX name');
recOLEControl.SETRANGE(Version,'1.0');
IF NOT(recOLEControl.FIND('-')) THEN
MESSAGE('OCX is not installed yet');</pre><hr /></blockquote><font size="2" face="Verdana, Arial">This example presumes you have created a record variable recOLEControl with Subtype "OLE Control".
To register the OCX on the client:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">recCompanyInfo.CALCFIELDS("OCX Component");
IF recCompanyInfo."OCX Component".HASVALUE THEN BEGIN
recCompanyInfo."OCX Component".EXPORT('myocx.ocx',FALSE);
intReturnValue := SHELL('regsvr32.exe','myocx.ocx');
END;</pre><hr /></blockquote><font size="2" face="Verdana, Arial">This code has not been tested, but this shows you the way.
I'm just about to upload the clipboard ocx. I'm currently writing some sample code for demonstration purpose. It will be uploaded sometime today.
Regards
Michael
I've just uploaded the clipboard ocx, so it should be available within the next couple of days.
Regards
Michael
thank you very much to both of you.
<img border="0" title="" alt="[Smile]" src="images/smiles/icon_smile.gif" /> Michael, I just loaded your OCX, and it works really fine, just the way I was looking for. Thank you very much.
<img border="0" title="" alt="[Smile]" src="images/smiles/icon_smile.gif" /> Luc, your idea to import an OCX in the database, to export it and to register it works fine (in my test-environment: Win98SE, Navision 2.60). You can combine the check and the installation.
To compile the code the OCX must be registered!
Also thank you very much to you.
You both are really great guys.
Best regards,
very happy Wolfram <img border="0" title="" alt="[Big Grin]" src="images/smiles/icon_biggrin.gif" />