Share via

ActiveDocument.AttachedTemplate doesn't provide path

Anonymous
2011-07-14T17:46:38+00:00

I'm trying to capture the full name of the ActiveDocument's attached template.  If I record attaching a template & look at the code, the ActiveDocument.AttachedTemplate shows the template name including the path.  But from within VBA, using ActiveDocument.AttachedTemplate, I don't get the path only the template name and extension.

Since the code will be used on different PCs by different people, I need to have the full name.  I know you can get it for the active document.  Is there a way to get it for the attached template?

Many thanks!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-07-15T04:37:27+00:00

Dim strTemplatePath As String

strTemplatePath = ActiveDocument.AttachedTemplate.Path & _

                  Application.PathSeparator & _

                  ActiveDocument.AttachedTemplate

MsgBox strTemplatePath

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2011-07-18T12:39:43+00:00

    Thank you!

    Was this answer helpful?

    0 comments No comments