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 (e-mail address removed) (Mr. Daniel Hayden),

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


(e-mail address removed) (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 (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top