N
NZ VBA Developer
OK Kids, here's the problem:
Client's IT elves have put together a deployment packages for rolling my
sweet-as templates to the unwashed masses. This package puts my masterpieces
into a folder the generic User templates location: 'C:\...\Application
Data\Microsoft\Templates'. And in my code I look for my templates in the
location specified in Word for the User templates
('Options.DefaultFilePath(wdUserTemplatesPath)' plus the name of the special
folder). All choice to this point.
However, the users have quite a bit of autonomy when it comes to configuring
their computers. Consequently, it's possible and highly likely that some of
the users will have changed their options in Word to look someplace other
than the standard, default, vanilla, as-installed location for User
templates. So it would make more sense for my code to look in
'C:\...\Application Data\blah...blah...blah', yes? Of course that location
varies by user, but the client's elves assure me that I can use the same
method they use for the deployment: look at the AppData variable.
Except I don't know how to put that into my code...
Here's a snippet that shows how things work at the moment:
Private Sub Templates
Dim SearchPath as String
SearchPath = Options.DefaultFilePath(wdUserTemplatesPath) & "\Standard
Templates\"
Call GetTemplates(SearchPath)
Private Sub GetTemplates(Path$)
Dim SearchTemplates$
SearchTemplates = Dir(Path & "*.dot*", vbNormal)
Do While SearchTemplates <> ""
If InStr(SearchTemplates, "~") = 0 Then
If Right(LCase(SearchTemplates), 4) = ".dot" Then
frmTemplates.ListBoxTemplates.AddItem Mid(SearchTemplates, 1,
Len(SearchTemplates) - 4)
Else
frmTemplates.ListBoxTemplates.AddItem SearchTemplates
End If
End If
SearchTemplates = Dir
Loop
End Sub
Obviously the change needs to be someplace in the line that sets the value
for SearchPath. A little help please?
--
Cheers!
The Kiwi Koder
Little know fact: Romania has been in every Rugby World Cup. After the play
the ABs they'll wish they missed this one...
Client's IT elves have put together a deployment packages for rolling my
sweet-as templates to the unwashed masses. This package puts my masterpieces
into a folder the generic User templates location: 'C:\...\Application
Data\Microsoft\Templates'. And in my code I look for my templates in the
location specified in Word for the User templates
('Options.DefaultFilePath(wdUserTemplatesPath)' plus the name of the special
folder). All choice to this point.
However, the users have quite a bit of autonomy when it comes to configuring
their computers. Consequently, it's possible and highly likely that some of
the users will have changed their options in Word to look someplace other
than the standard, default, vanilla, as-installed location for User
templates. So it would make more sense for my code to look in
'C:\...\Application Data\blah...blah...blah', yes? Of course that location
varies by user, but the client's elves assure me that I can use the same
method they use for the deployment: look at the AppData variable.
Except I don't know how to put that into my code...
Here's a snippet that shows how things work at the moment:
Private Sub Templates
Dim SearchPath as String
SearchPath = Options.DefaultFilePath(wdUserTemplatesPath) & "\Standard
Templates\"
Call GetTemplates(SearchPath)
Private Sub GetTemplates(Path$)
Dim SearchTemplates$
SearchTemplates = Dir(Path & "*.dot*", vbNormal)
Do While SearchTemplates <> ""
If InStr(SearchTemplates, "~") = 0 Then
If Right(LCase(SearchTemplates), 4) = ".dot" Then
frmTemplates.ListBoxTemplates.AddItem Mid(SearchTemplates, 1,
Len(SearchTemplates) - 4)
Else
frmTemplates.ListBoxTemplates.AddItem SearchTemplates
End If
End If
SearchTemplates = Dir
Loop
End Sub
Obviously the change needs to be someplace in the line that sets the value
for SearchPath. A little help please?
--
Cheers!
The Kiwi Koder
Little know fact: Romania has been in every Rugby World Cup. After the play
the ABs they'll wish they missed this one...