diff --git a/jacob/docs/ReleaseNotes.html b/jacob/docs/ReleaseNotes.html index e43e019..cae4d40 100644 --- a/jacob/docs/ReleaseNotes.html +++ b/jacob/docs/ReleaseNotes.html @@ -5,13 +5,13 @@
+If you see the following message then you probably don't have the right C++ libraries. +
+Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\apps\...\jacob.dll: This application has fa +iled to start because the application configuration is incorrect. Reinstalling the application may fix this pr +oblem +
-http://www.microsoft.com/downloads/details.aspx?familyid=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displaylang=en -http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&displaylang=en + +Visual C redistributable installer SP1
diff --git a/jacob/samples/com/jacob/samples/office/VisioPrintTest.java b/jacob/samples/com/jacob/samples/office/VisioPrintTest.java new file mode 100644 index 0000000..d47cb08 --- /dev/null +++ b/jacob/samples/com/jacob/samples/office/VisioPrintTest.java @@ -0,0 +1,45 @@ +package com.jacob.samples.office; + +import com.jacob.activeX.ActiveXComponent; +import com.jacob.com.ComFailException; +import com.jacob.com.Dispatch; + +/** + * Snippet to show Visio print dialog + *
+ * Sample submitted by fatbuttlarry in SourceForge 1803140 + * as part of bug report + *
+ * Tested with Java 6.0SE and MS Office 2003 ** Note: 1010 = VB's + * visCmdFilePrint constant + */ +public class VisioPrintTest { + + /** + * Runs the print ant lets the user say ok or cancel. Note the funky Visio + * behavior if someone hits the cancel button + * + */ + public void testPrintDialog() { + ActiveXComponent oActiveX = new ActiveXComponent("Visio.Application"); + Dispatch oDocuments = oActiveX.getProperty("Documents").toDispatch(); + // create a blank document + Dispatch.call(oDocuments, "Add", ""); + try { + Dispatch.call(oActiveX, "DoCmd", new Integer(1010)) + .getInt(); + System.out.println("User hit the ok button."); + } catch (ComFailException e) { + System.out.println("User hit the cancel button: " + e); + } finally { + oActiveX.invoke("Quit"); + } + return; + } + + /** quick main() to test this */ + public static void main(String[] args) { + VisioPrintTest testObject = new VisioPrintTest(); + testObject.testPrintDialog(); + } +}