L
lazarevd
hallo liebe gemeinde, ich hab große schwierigkeiten bei der umsetzung diese vb-codes in java:
Sub WordPro_to_MSWort()
DIM app As Object
Set app = CreateObject("WordPro.Application");
With app
.Visible = False
.OpenDocument("c:\1.LWP")
.SaveAs "C:\1.DOC","","MS Word 2000", False, True, False
.Parent.Quit
End With
End Sub
Alles was ich bis jetzt habe:
public void run(){
OleFrame oleFrame = new OleFrame(new Shell(),SWT.None);
OleClientSite controlSite=new OleClientSite(oleFrame, SWT.NONE,"WordPro.Document");
OleAutomation document = new OleAutomation(controlSite);
int[] methodID = document.getIDsOfNamens(new String[]{"Application"});
Variant vApplication = document.getProperty(methodID[0]);
methodID = vApplication.getAutomation().getIDsOfNames(new String[]{"Visible"});
vApplication.getAutomation().setProperty(methodID[0],new Variant(true));
/*
Hier sollte ich nun die Datei öffnen können und abspeichern können, hab es trotz vielen versuchen nicht geschafft. Hoffe auf Hilfe!
*/
}
Wäre sehr dankbar für Hilfe, danke im voraus!
}
Sub WordPro_to_MSWort()
DIM app As Object
Set app = CreateObject("WordPro.Application");
With app
.Visible = False
.OpenDocument("c:\1.LWP")
.SaveAs "C:\1.DOC","","MS Word 2000", False, True, False
.Parent.Quit
End With
End Sub
Alles was ich bis jetzt habe:
public void run(){
OleFrame oleFrame = new OleFrame(new Shell(),SWT.None);
OleClientSite controlSite=new OleClientSite(oleFrame, SWT.NONE,"WordPro.Document");
OleAutomation document = new OleAutomation(controlSite);
int[] methodID = document.getIDsOfNamens(new String[]{"Application"});
Variant vApplication = document.getProperty(methodID[0]);
methodID = vApplication.getAutomation().getIDsOfNames(new String[]{"Visible"});
vApplication.getAutomation().setProperty(methodID[0],new Variant(true));
/*
Hier sollte ich nun die Datei öffnen können und abspeichern können, hab es trotz vielen versuchen nicht geschafft. Hoffe auf Hilfe!
*/
}
Wäre sehr dankbar für Hilfe, danke im voraus!
}