Help in VBA Password Properties when creating reference

M

Mr. Daniel Hayden

I am trying to create a reference in code using:

AddIns.Add FileName:= _
"C:\Test.dot", Install:=True
ActiveDocument.UpdateStylesOnOpen = False

ThisDocument.VBProject.References.AddFromFile "C:\Test.dot"
'***PROBLEM CODE

The reference will be created and works fine, but I am always prompted
for a TemplateSuite password on Document_New and Document_Open. The
first section of code that adds the AddIn works fine.

Since I am generating a reference to a file in code when my VBA
Project is locked and password protected, I continually get prompted
for a password. The only time I am able to get the system to work
seemlessly is by unlocking the VBA Project; however, this leaves my
VBA Project This Document code open for viewing by our users.

I am also able to cancel the TemplateSuite Password prompt and the
document with the new built reference opens fine.

Thanks for any leads!!!

Daniel
 
W

Word Heretic

G'day [email protected] (Mr. Daniel Hayden),

Hmmm... have you tried an Application.DisplayAlerts=wdAlertsNone ???


[email protected] (Mr. Daniel Hayden) was spinning this yarn:
I am trying to create a reference in code using:

AddIns.Add FileName:= _
"C:\Test.dot", Install:=True
ActiveDocument.UpdateStylesOnOpen = False

ThisDocument.VBProject.References.AddFromFile "C:\Test.dot"
'***PROBLEM CODE

The reference will be created and works fine, but I am always prompted
for a TemplateSuite password on Document_New and Document_Open. The
first section of code that adds the AddIn works fine.

Since I am generating a reference to a file in code when my VBA
Project is locked and password protected, I continually get prompted
for a password. The only time I am able to get the system to work
seemlessly is by unlocking the VBA Project; however, this leaves my
VBA Project This Document code open for viewing by our users.

I am also able to cancel the TemplateSuite Password prompt and the
document with the new built reference opens fine.

Thanks for any leads!!!

Daniel

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email [email protected]
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 
Top