Home » Developing U++ » UppHub » OleAut : Office Automation Encapsulation, then made easy
OleAut : Office Automation Encapsulation, then made easy [message #51270] |
Tue, 26 February 2019 17:06 |
omari
Messages: 264 Registered: March 2010
|
Experienced Member |
|
|
Hi,
this package hide all low-level complexity, using U++ habits like operator overloading and type conversion operators.
it work directly with Upp types like String, int ... (no need for BSTR ,VARIANT,..)
I do not forget to thinks Koldo for the package OfficeAUtomation, as it is my start point
here an example:
Save WinWord document as unicode text:
bool SaveFileAsUnicodText(String filein, String fileout)
{
OleObject App;
OleObject doc = App("Documents.Open", filein, false, true, false);
if(!doc) return false;
doc.Set("TextEncoding", 65001); // vUtf = 65001
bool r = doc("SaveAs", fileout, 7); // wdFormatUnicodeText = 7
doc("Close");
//App("Quit");
return r;
}
OleAutTest package containe an Excel example and a Windows Script Shell one.
-
Attachment: OleAut.zip
(Size: 8.71KB, Downloaded 209 times)
regards
omari.
[Updated on: Mon, 04 March 2019 14:50] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Mar 29 01:57:47 CET 2024
Total time taken to generate the page: 0.01971 seconds
|