Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DocProperty changes when reopening a file

    Hello


    I have a problem with a DocProperty I've called "DocRef" As you can see, it contains severall parts:

    ----------------------------
    '--- DocRef
    If ActiveDocument.CustomDocumentProperties("Level") <> "4" Then
    cDocRef = "L" & ActiveDocument.CustomDocumentProperties("Level") & " - " & _
    ActiveDocument.CustomDocumentProperties("Disciplin e") & " - " & DocNumber
    Else
    cDocRef = "L" & ActiveDocument.CustomDocumentProperties("Level") & " - " & _
    ActiveDocument.CustomDocumentProperties("Disciplin e") & " - " & _
    ActiveDocument.CustomDocumentProperties("Rigname") & " - " & DocNumber
    End If


    ActiveDocument.CustomDocumentProperties.Add Name:="DocDesc", LinkToContent:=False, _
    Value:=cDocDesc, Type:=msoPropertyTypeString

    ActiveDocument.CustomDocumentProperties.Add Name:="RevNo", LinkToContent:=False, _
    Value:="0", Type:=msoPropertyTypeString

    ActiveDocument.CustomDocumentProperties("DocRef") = cDocRef
    ActiveDocument.CustomDocumentProperties("DocDesc") = cDocDesc

    Call modUpdateFields.UpdateFields

    UpdateProfile (DocNumber)
    ---------------------------

    When saving the document right information is provided, but when closing and opening the file, the "DocRef" only shows the last part - "DocNumber".

    Anybody knows why this happens? We're using Word 2010 on a W7-plattform.

    UPDATE:
    I've found out that this problem is not valid in Word 2003. The document is based on a template made for 2003 enviroment, and converted to 2010.

    Thanks
    Last edited by Motifman; 2012-10-11 at 04:29. Reason: Update

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    I don't think we can see enough of your code to work out where the problem lies.

    What data type is cDocRef?
    What is the type for
    ActiveDocument.CustomDocumentProperties("DocRef")? If it is defined as a number then that might be the problem.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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