Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Problems With Reference to Addin

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
me@me.com - 12 Nov 2004 16:32 GMT
Hi Folks,
I'm having trouble with a Template which sets a reference to an addin using
MyTemplate.ThisDocument.VBProject.References.AddFromFile strRef.

If the document needs to move to another environment which has a different
setup to the originating env it can use a Wizard, which opens the document,
adds the addin appropriate to that env using  "AddIns.Add
FileName:=strTemplate(1), Install:=True".
But something somewhere goes wrong and when i check my references it says
Missing and points to a temp file : C:\Documents and Settings\User\Local
Settings\Temp\3\WRL????.???

**This is in the wizard to open the doc**

Set MyDialog = Dialogs(wdDialogFileOpen)
MyDialog.Format = wdFormatDocument

If MyDialog.Display <> -1 Then GoTo ErrOpen
   MyDialog.Execute
   ActiveDocument.AttachedTemplate = ""
End If

Can anyone help me with this?

Cheers

J
Perry - 15 Nov 2004 00:29 GMT
Have you tried to compile your project?

Before twisting yr mind about what is happening to the reference y're
trying to set, below lines are not compilable...

> If MyDialog.Display <> -1 Then GoTo ErrOpen
>     MyDialog.Execute
>     ActiveDocument.AttachedTemplate = ""
> End If

The If Then block is not valid in above sequence.

Krgrds,
Perry

> Hi Folks,
> I'm having trouble with a Template which sets a reference to an addin using
[quoted text clipped - 23 lines]
>
> J
me@me.com - 15 Nov 2004 13:33 GMT
Hi Perry,
My mistake...there should be no end if at the end of that statement and the
code I have does compile fine.  I have no idea why the temp file is being
used rather than the absolute reference I put in.

If the reference already exists and I tried to add a reference with On Error
Resume Next would it remove the existing reference or cause problems I am
seeing here??

Cheers

J

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.