Devel-PerlySense
view release on metacpan or search on metacpan
t/data/simple-lib/lib/Win32/Word/Writer.pm view on Meta::CPAN
it may affect you too.
It's a very bad thing anyhow, since it can cause your
program to just freeze, waiting for user interaction. To
boot, the dialog boxes are usually displayed below other
applications.
I blame Bill.
=head2 OLE errors during global destruction
If you are in the middle of a table and something goes
wrong, there will be strange OLE warnings during global
destruction. I haven't found out why this happens.
=head2 Layout too complex
I have run into this problem where, despite the no-don't-
show-dialogs, Word pops up an error dialog below all other
windows (so you can't see it, great!).
After clicking Ok in this dialog a number of times, the OLE
call finally fails properly and dies in the Perl
application layer.
http://support.microsoft.com/kb/292174
The only way to not run into this problem seems to be to
save the document to disk after adding some text. The
Checkpoint() method does this for you.
=head2 Rouge WINWORD.EXE processes
Sometimes it seems like Win32::OLE has some problems with
closing the Word instance during global destruction. This
happens mostly when things die().
=head1 TODO
Tests for Tables of Contents etc
Tests for Bookmarks
=head1 APPLICATION DOM INFORMATION
So what does the Word DOM look like? Actually, the documentation is
available when installing Office.
Start Word and press Alt-F11 to bring up the VBA window. There is an
Object Browser in the toolbar. Select an object, method or property
and press F1 to bring up the help.
A good way to figure out how to do something is to record a Macro and
then bring up the VBA window and inspect the code written by the Macro
Recorder.
=head1 DESIGN ISSUES
=head2 Software versions
This is tested and developed using w2k and Office 2000.
Things may be different with other versions. Please let me know.
=head2 Supressing the "Save as..." dialog box
The problem with this is that it doesn't work to follow the
manual and advice found on the Net.
The usual answer is to set DisplayAlerts to False, or
wdAlertsNone. That doesn't work for me.
What works is to set the Document.Saved property to False
before quitting (the MarkDocumentAsSaved() method).
That's why the ActiveX object is Quit from the DESTROY
method, and not using the exit handler in CreateObject which
is the normal course of action.
=head1 GOOD IDEAS
=head2 Keep an eye on the Task Manager
When you fiddle around with this program, it's useful to
keep the Task Manager window open to keep track of any
WINWORD.EXE processes that may be stuck in memory if you
e.g. C-Break out of the script (don't do that, Win32::OLE
won't have a chance of cleaning up the Word instance it
created).
Kill abandoned Word processes (but make sure you don't kill
any documents you may be editing :)
=head1 EXTENDING THE MODULE
The interface of this module is spotty in an opportunistic
way; I have added utility methods as I needed them.
If you need to add your own methods, I suggest you simply
inject them in this namespace to get your application
working and send me a patch.
=head1 PRIVATE PROPERTIES
These are considered implementation details, but you may need to
fiddle with them if you extend the module.
( run in 1.030 second using v1.01-cache-2.11-cpan-97f6503c9c8 )