-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.13 release notes updates with more details about redistributable pa…
…ckages.
- Loading branch information
clay_shooter
committed
Oct 6, 2007
1 parent
a593a26
commit 3328e58
Showing
3 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
jacob/samples/com/jacob/samples/office/VisioPrintTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
* <p> | ||
* Sample submitted by fatbuttlarry in SourceForge 1803140 | ||
* as part of bug report | ||
* <p> | ||
* 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(); | ||
} | ||
} |