Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
JagoVB JagoVB is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 508
Rep Power: 15
JagoVB mempunyai hidup yang Normal
Default Mail Merge OpenOffice / LibreOffice & VB6

om2... ada yang tau gmana cara meng-otomatis-kan mail merge di LibreOffice/OpenOffice di VB6 ato di Delphi?



cari2 di abang gugel dapet sample kaya gini


Code:

'Creating service manager
Set objServiceManager = CreateObject("com.sun.star.ServiceManager")
'Creating a public object to use reflection for structured properties
Set objCoreReflection = objServiceManager.createInstance("com.sun.star.ref lection.CoreReflection")

'Creating a mailmerge object
Set objMailMerge = objServiceManager.createInstance("com.sun.star.tex t.MailMerge")

'Setting properties
Dim args(0 To 6)
'Url of the source document
Set args(1) = OOoNamedValue("DocumentURL", "file:///d:/temp/cmk.rtf")
'Name of the datasource linked in OO (change it accordingly to your needs)
Set args(0) = OOoNamedValue("DataSourceName", "Bibliography")
'Takes data from 0=tables 1=links 2=queries
Set args(2) = OOoNamedValue("CommandType", 0)
'Name of the datacontainer
Set args(3) = OOoNamedValue("Command", "table1")
'The next fields depend one from each other, this is an example
'Output to 1=printer 2=file
Set args(4) = OOoNamedValue("OutputType", 2)
'Having selected output to file we choose the url of the result files
Set args(5) = OOoNamedValue("OutputURL", "file:///urltoresultfiles/")
'I select the name of the result files
Set args(6) = OOoNamedValue("FileNamePrefix", "auto")
objMailMerge.Execute args()

Function OOoNamedValue(cName, uValue)
Set oPropertyValue = createStruct("com.sun.star.beans.NamedValue")

oPropertyValue.Name = cName
oPropertyValue.Value = uValue

Set OOoNamedValue = oPropertyValue
End Function

Function createStruct(strTypeName)
Set classSize = objCoreReflection.forName(strTypeName)
Dim aStruct
classSize.CreateObject aStruct
Set createStruct = aStruct
End Function

tapi kalo di execute ada error di baris yang dimerahin

Runtime Error 424 - Object Required



LibreOffice SDK udah diinstall







Aslinya sekarang pake Ms Office 2003, trus mau diconvert jadi LO/OOo....



thanks...

</div>
Reply With Quote
Reply


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


Terkait
Thread Thread Starter Forum Replies Last Post
E-Mail , Domain, Unlimited Mail Box, Anti-Spam &amp; Viruses ! Australian Service lainnya 0 15th October 2012 07:26 AM
JUAL [Lost Saga] Data Lengkap , E-mail + Lupa Password E-mail PirateKids Online Gaming 0 5th October 2012 11:12 AM
JUAL Jual CD LibreOffice &amp; OpenOffice for windows x86 processcpu Software Original & Open Source 0 26th May 2012 09:54 AM
[ask] open office, mail merge problem KernelMad Linux & Open source community 0 23rd November 2011 02:14 PM
Program mirip Mail Merge PHPmaster Programming 0 20th November 2011 01:03 AM

 


All times are GMT +7. The time now is 11:45 AM.