PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
How to reference Normal.dot?-VBForums
Results 1 to 3 of 3

Thread: How to reference Normal.dot?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    How to reference Normal.dot?

    I'm writing a macro which copies a style (Default Paragraph Font) from the users Normal.dot template file. At the moment it's hard-coded to point it to my own template, but how can I edit this so it will use the normal template of whoever runs the macro?

    VB Code:
    1. Dim Dest As String
    2. Dim Norm As Template
    3.  
    4. Dest = ActiveDocument.Path & "\" & ActiveDocument.Name
    5.  
    6. 'add DPF
    7. If Not StyleExists("Default Paragraph Font") Then
    8.     Application.OrganizerCopy Source:= _
    9.         "C:\Documents and Settings\pickarooney\Application Data\Microsoft\Templates\Normal.dot" _
    10.         , Destination:=Dest, Name:="Default Paragraph Font", Object:=wdOrganizerObjectStyles
    11. End If

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,593

    Re: How to reference Normal.dot?

    Think you need api's to return the "application data" path for each user,

    found this link though, - http://www.thescarms.com/vbasic/specialfolders.asp

    you can download the source code too, so it may help !!!

  3. #3
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: How to reference Normal.dot?

    Hi,

    If you're in VBA:

    VB Code:
    1. strPath = Options.DefaultFilePath(wdUserTemplatesPath)

    will get you the path.

    zaza

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width