"" <jpgmt_at_sbcglobal_dot_net>
2006-10-25 08:18:44 UTC
I need my addin's modules to exec for only a specific template, so placing
the code that calls that template works, but not with Med security settings,
perhaps there's a way around this?
The macros work when manually executed, I have an automated process that
prints doc's w/little or no user intervention, similar to right-clicking on
a template and selecting Print.
My first attempt I put code into the special template that called the module
in the addin and all was fine and dandy.
This fine & dandy setup, ONLY works when security is set to Low, so I tried
to implement oApp_DocumentOpen in ThisDocument, and call my module, but that
fails to execute because of two reasons, (the oApp_NewDocument calls the
oApp_DocumentOpen sub)
Opening a New doc from the template:
1. In my module it check's for a specific doc name, opening my template gets
Document1 - n that name is not unique so it fails, remember I don't want the
addin's modules to exec for any other template.
2. Since the Addin loads prior to the template.dot or it's new document1.doc
the module doesn't exec, if it does I get an error that there is no doc
open.
I tried adding a delay into the addin, but that only delays the addin from
finishing loading and eventually it fires prior to the template.dot or
document1.doc loading and with the tests for template name it fails to run
the module.
If I add a reference to my addin in the template and a Document_Open event
Private Sub Docuemnt_Open()
myTemplateProject.Auto_Start
End Sub
Set the security settings to low.
This works, I have a wrapper module called Auto_Start that checks a few
things prior to running, like reading the server name and SQL sProc from an
ini file, getting the database name etc...
Setting the security back to Med., now I'm prompted that the doc contains
macros, Arrrghh!
Any help would be appreciated.
JeffP.....
the code that calls that template works, but not with Med security settings,
perhaps there's a way around this?
The macros work when manually executed, I have an automated process that
prints doc's w/little or no user intervention, similar to right-clicking on
a template and selecting Print.
My first attempt I put code into the special template that called the module
in the addin and all was fine and dandy.
This fine & dandy setup, ONLY works when security is set to Low, so I tried
to implement oApp_DocumentOpen in ThisDocument, and call my module, but that
fails to execute because of two reasons, (the oApp_NewDocument calls the
oApp_DocumentOpen sub)
Opening a New doc from the template:
1. In my module it check's for a specific doc name, opening my template gets
Document1 - n that name is not unique so it fails, remember I don't want the
addin's modules to exec for any other template.
2. Since the Addin loads prior to the template.dot or it's new document1.doc
the module doesn't exec, if it does I get an error that there is no doc
open.
I tried adding a delay into the addin, but that only delays the addin from
finishing loading and eventually it fires prior to the template.dot or
document1.doc loading and with the tests for template name it fails to run
the module.
If I add a reference to my addin in the template and a Document_Open event
Private Sub Docuemnt_Open()
myTemplateProject.Auto_Start
End Sub
Set the security settings to low.
This works, I have a wrapper module called Auto_Start that checks a few
things prior to running, like reading the server name and SQL sProc from an
ini file, getting the database name etc...
Setting the security back to Med., now I'm prompted that the doc contains
macros, Arrrghh!
Any help would be appreciated.
JeffP.....