Results 1 to 9 of 9
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    All Docs based on Template (Word 97SR2)

    Since all Word documents are based on a template, can someone tell me which template is used when creating a Word document using

    Set aDoc = CreateObject("Word.Document")

    It's not the Winword.doc (or winwordx.doc) where x = the version number (8,9,10) if more than one version of Office is installed on the same PC. On a Win2k PC, that winword.doc file is located in this folder (in my case):

    Cocuments and SettingsKevinTemplates

    I want to be able to assure that aDoc above is

    1) hidden
    2) based on our firm normal.dot
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All Docs based on Template (Word 97SR2)

    Default is to use the Normal template.
    The winword*.doc files are documents, not templates.

    I'd suggest:

    Option Explicit

    Private Sub GobbleGobble()
    Dim aDoc As Document
    Set aDoc = Documents.Add
    End Sub

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All Docs based on Template (Word 97SR2)

    Winword.doc is indeed a document, but is used by the OS as a template when a user creates a new doc from the desktop.

    As to your suggested Gobble code, right on!

    That's the ticket. <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

    I believe that the Createtobject object uses either the "built-in" Word defualt settings or the winword.doc (template) found under the default user folder:

    c:documents and settingsdefault usertemplates

    because all our Normal.dot and firm normals do not have TNW 10 pt. as the default font. But a document created with Createojbect does!
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All Docs based on Template (Word 97SR2)

    Winword.doc is a document that is attached to some template, likely Normal.

    The template used is not winword.doc.

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All Docs based on Template (Word 97SR2)

    Humm...

    <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q136/2/16.asp>http://support.microsoft.com/support/kb/ar...s/Q136/2/16.asp</A>

    <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q135/8/86.asp>http://support.microsoft.com/support/kb/ar...s/Q135/8/86.asp</A>
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All Docs based on Template (Word 97SR2)

    Yes, those articles confirm what I said. See the last sentence of the CAUSE in q136216.

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All Docs based on Template (Word 97SR2)

    This is a tad off-topic, but a bit related:

    Howard, do you happen to have the original post of this text? I borrowed your function and can't remember what it was supposed to do. I've probably chopped it about a bit .....


    <pre>Public Function blnNotVBA(strWordFile As String) As Boolean
    ''Re: Two related questions: SendKeys and version of Tem
    ''
    ''Howard Kaikow
    ''Thu 16-Nov-00, 06:52 am
    ''
    ''
    '' Thanx.
    ''
    '' I tried a variant given below.
    ''
    '' In addition, I recalled that KB article Q224351 describes a DLL from MSFT that
    '' allows access to the document summary properties. They include source code,
    '' but I have not yet looked at it.
    ''
    '' Here 's what I'm (ab)using in the interim. It does not check for non-Word files,
    '' but I do not need to do that for this purpose.
    ''
    Const strMSWordDocument As String = "Microsoft Word Document"
    Const strMSWordDoc As String = "MSWordDoc"
    Const strWordDocument As String = "Word.Document.8"
    Dim intFileno As Integer
    Dim lngFileLength As Long
    Dim lngPos As Long
    'Procs Dim lngPrevPos As Long
    Dim strFileContent As String
    ' Word97/SR2 fails if unsaved document with text; returns text if contents were deleted.
    intFileno = FreeFile
    Open strWordFile For Binary As intFileno
    lngFileLength = LOF(intFileno)
    strFileContent = Input(lngFileLength, intFileno)
    Close intFileno
    blnNotVBA = True
    lngPos = InStr(1, strFileContent, strMSWordDocument, vbBinaryCompare)
    If lngPos <> 0 Then
    lngPos = InStr(lngPos + 1, strFileContent, strMSWordDoc, vbBinaryCompare)
    If lngPos <> 0 Then
    lngPos = InStr(lngPos + 1, strFileContent, strWordDocument, vbBinaryCompare)
    If lngPos <> 0 Then
    blnNotVBA = False
    End If
    End If
    End If
    'Sub testblnNotVBA()
    'MsgBox blnNotVBA(ActiveDocument.FullName)
    'End Sub
    End Function

    </pre>


  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All Docs based on Template (Word 97SR2)

    That looks like a modified version of some old code that I created for a simple example. Code was not really correct, it was just a hack.

    Intention was to determine whether the activedocument was created with a Word version earlier than 8.

    I have a corrected version, but I cannot distribute the code.

    This is really not the right way to do the deed.
    As I recall, MSFT has made a DLL available to access file properties.

    Another way may be with API calls.

  9. #9
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All Docs based on Template (Word 97SR2)

    > made a <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q224/3/51.ASP>DLL</A> available to access file properties

    <pre>MsgBox PropertyReader.GetDocumentProperties("d:20011125er aseme.doc").Version
    </pre>


    Thanks Howard.

Posting Permissions

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