Ошибка неизвестное имя свойства документа word

  • Question

  • HI..

All replies

  • Select File > Info.

    On the right hand side, click Properties > Advanced Properties.

    Activate the Custom tab.

    Type a name, select a type, and enter a value if desired, then click Add.


    Regards, Hans Vogelaar

  • I tried but doesnt show on document property list

    can you try?

  • To reference the property via a DOCPROPERTY field in the document, go to the document itself (not a dialogue), press Ctrl-F9 and type ‘DOCPROPERTY test’ between the field braces (ie {DOCPROPERTY test}), then press F9 to update the field.


    Cheers
    Paul Edstein
    [MS MVP — Word]

    • Edited by

      Wednesday, August 1, 2012 5:23 AM

  • Hi,

    Based on my research, this should be done with Microsoft Office InfoPath.

    The properties that appear in the Document Information Panel can’t be changed unless you add custom properties by using a property management server or a Microsoft Office InfoPath form.
    You can add some custom properties by clicking Advanced Properties in the upper left of the Document Information Panel, but the properties will not appear in the Document Information Panel or in the document itself.

    1. Click the File ->Info->
      Properties->Show Document Panel

    The Document Information Panel opens above your document.

    1. Fill out the property information that you want to keep with your document.

    Notes :

    • The Required field flag appears only with properties that are bound to documents that are stored on property management servers. Built-in properties are never required for a document.
    • You can add custom properties to the Document Information Panel if you are using a property management server, such as Microsoft Office SharePoint Server, and Office InfoPath.

    Here’s the link to refer:

    http://office.microsoft.com/en-us/help/add-property-information-to-a-document-HA010163766.aspx

    The link is for Word 2007. I have changed the steps in the above information for Word 2010.

    The following link is about “Design a Document Information Panel by using InfoPath”, but it is also applies to InfoPath 2007, you can refer:

    http://office.microsoft.com/en-us/infopath-help/design-a-document-information-panel-by-using-infopath-HA010201967.aspx


    Jaynet Zhang

    TechNet Community Support

  • Hi Jaynet,

    Many of us have been creating & referencing custom document properties since way before InfoPath existed. There is no need to use InfoPath to do so now.


    Cheers
    Paul Edstein
    [MS MVP — Word]

    • Edited by
      macropodMVP
      Wednesday, August 1, 2012 6:44 AM

  • Hi paul,

    Not working

    • Edited by
      MGerio
      Wednesday, August 1, 2012 7:13 AM

  • Your ‘Error! Unknown document property name’ message suggests you have mis-typed the property name, or you’re using it in a document that doesn’t have the ‘test’ document property.

    The bookmark error messages suggest you’re trying to reference an non-existent bookmark — document properties are not bookmarks.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • Your DOCPROPERTY field should look like what I posted:

    {DOCPROPERTY test}

    Simply having { test } creates nothing more than a bookmark reference. That ain’t gonna fly…

    Because it’s a custom property, all you’ll see in the document after updating is the field’s value:

    test


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • Create a custom document property:

    To insert a DOCPROPERTY field, either use Insert > Quick Parts > Field…, or use Ctrl+F9 as described by macropod.


    Regards, Hans Vogelaar

  • That looks about right.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • All document properties on the ‘Custom’ properties tab are editable/customizable. To
    create or change a property, you access it via the dialogue box or via vba. To
    reference them, you use DOCPROPERTY fields or vba.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • Can document custom property be inserted, edited and look like this?

  • Can document custom property be inserted, edited and look like this?

    No, not as far as I know. Edit in the Document Properties dialog, display through a DOCPROPERTY field.


    Regards, Hans Vogelaar

  • How sad..

    however… I noticed that when i close the word program and reopen a new instance, my custom Doc property are gone.

    But on the document itself where i put my custom doc property, items are retained.

    why is that so?

    • Edited by
      MGerio
      Thursday, August 2, 2012 5:21 AM

  • Custom document properties are stored, as the name indicates, in the document (or template). They will not be available elsewhere.


    Regards, Hans Vogelaar

    • Marked as answer by
      Jaynet Zhang
      Tuesday, August 7, 2012 1:43 AM
    • Unmarked as answer by
      MGerio
      Saturday, August 18, 2012 4:59 AM

  • There are now two sorts of «Custom Document Property» in Word:

    The old sort, where you create/maintain them in the «Advanced Properties»->Custom dialog pane, and insert them using
    DOCPROPERTY fields. These are not displayed in the «Document Property» drop down you display in your original post.

    The new sort, which are the sort that Jaynet Zhang describes. These are typically, but not necessarily, related to columns created in a SharePoint library. When a document is opened from Sharepoint, Sharepoint inserts information about the names and values
    of these columns in Word. Their names then appear in the Document Property dropdown. When you insert one of the Properties from this dropdown, Word inserts a
    Content Control that is linked to the value of the property. However, not all the names in that dropdown are related to SharePoint properties — some are «Builtin» Properties such as Author, and others come from a special set of «Cover Page Properties»
    introduced in Word 2007 (Company fax, etc.)

    Arguably the first sort of Property is the «true» «Custom Document Property», but since the second sort are also described as «Document Properties» and can be user-created (by a SharePoint user), and do not seem to have a well-established name, people not
    unnaturally refer to them using the same name as the first sort. Sometimes they are referred to as «Server Properties»

    Using VBA or other coding techniques, it is theoretically possible to set up «Server Properties» without either Sharepoint or InfoPath by creating some chunks of «Custom XML» (another reason why the word «Custom» is sometimes used for these properties).
    However, without the server present, these properties do not work in quite the same way as the «real thing» — e.g., with the server present, there is more validation.

    The thing about «Server Properties» and the other properties on the dropdown is that each Content Control is linked to a specific property held in the document’s XML. If you have more than one content control linked to the same property value, when the property
    value is updated, the value in each of the linked Content Controls is updated automatically. That does not happen with DOCPROPERTY fields, and unfortunately it is

     a. not possible to link a Content Control directly to the value of the old type of Custom Property.

     b. either not possible, or not easy, to include DOCPROPERTY fields in the dropdown.

    So which type of control you choose depends on what you are trying to achieve, and the environment you are working in. 


    Peter Jamieson

    • Edited by
      Peter Jamieson
      Thursday, August 16, 2012 8:32 AM
      content control->custom property in point (a)
    • Proposed as answer by
      Hunter.CHEN
      Wednesday, March 2, 2016 4:56 AM

  • Thanks Peter. Very informative.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • I Wonder..

    Engineer is not listed in default document property but I received a document with this doc property:

    How Do I create this?

  • Let’s step back.

    There are several ways to show «repeating data» in Word documents. Greg Maxey documents most of them at
    http://gregmaxey.mvps.org/word_tip_pages/repeating_data.html 

    You may find it useful to have a look around his site, particularly this page:
    http://gregmaxey.mvps.org/word_tip_pages/mapped_content_controls.html

    What you are showing is a Content Control with some text in it. The text might or might not be the value of a «document property».

    You can make your own Content Controls in the Developer Tab (you can enable it in Word Options). You can modify the title (in this case «engineer») using the Properties button in the Developer tab. And you can type some text into the Content Control.

    At that point you have a Content Control containing some text. I wouldn’t personally call that a «document property,» because to me a property is something that can exist independently of what you put on the document surface. In the case of Word, it is also
    possible to insert copies of the value of most (if not all) types of property on the document surface. For example, you can insert copies of the value of the built-in Author property using an { AUTHOR } field. Others here have described the mechanism you can
    use with DOCPROPERTY fields.

    To do that with Content Controls, you have at least to link the Content Control with a piece of data stored outside the document surface. If someone has done that in this case, you ought to be able to do the following:

     a. copy/paste a copy of the Content Control into your document

     b. edit the text «Nikoli Tesla» in one of the Content Controls (CCs)

     c. click somewhere outside the control. 

    If the content of the other control changes, then the two controls are linked to a piece of data held outside the document surface. In this case, that might have been achieved in a number of different ways, e.g.

     1. someone might have inserted one of the standard Document Properties (e.g. using insert->Quick Parts->Document Property and selecting «Comments»), then modified the Title of the property to be «engineer.» In that case, modifying the value of
    the builtin Comments property would cause the text in the CC to change and vice versa. If so, the document creator has not created a
    new property, just the title used to display it in one part of their document.

     2. someone might have created and inserted a custom XML part containing an element or attribute that contains the text «Nikoli Tesla», created and inserted a Content Control with title «engineer», and linked that control to the XML element/attribute.
     

    At least (2) and probably (1) is/are described in the Mapped Content Controls article referenced above. 

     3. someone might have created the document in a Sharepoint library that has a column defined with the display name «engineer». In that case (unlike the other two cases above), an «engineer» property would probably (but not necessarily) be present in
    the drop down list of Document Properties. These types of properties are the ones sometimes described as «Server Properties», and are not currently covered by Greg in his article (for one thing, they have a more complex XML representation).

    Whether you regard all those things (1), (2), (3) as Document Properties is arguable, really. They are obviously «properties of a document». The main sense in which (1), (3) and the old «Custom Document Properties» differ from (2) is that the way they are
    stored is defined in the ECMA/ISO standards documents for Word .docx type documents.


    Peter Jamieson

    • Proposed as answer by
      Hunter.CHEN
      Wednesday, March 2, 2016 4:56 AM

  • check this link this may help you out

    http://superuser.com/questions/285256/word-2010-how-to-reference-custom-document-properties

  • Its awkward.

    Seems a plain document property name insertion/customization doesn’t have a simple execution.

    Does it have to take a brilliant programmer to have an «add», «modify» or «rename» document property option in Microsoft Word 2010?

    • Edited by
      MGerio
      Wednesday, August 22, 2012 2:47 AM

  • @maan

    Link is same as instruction in earlier replies.

  • Its awkward.

    Seems a plain document property name insertion/customization doesn’t have a simple execution.

    Does it have to take a brilliant programmer to have an «add», «modify» or «rename» document property option in Microsoft Word 2010?

    Word already has the facility to add/modify/delete a Document Property. You do that via the processes already discussed.

    What you seem to not recognise is that what you’re showing is not the Document Property itself but, at most, a reference to it. Of course, if you use a Content Control for maintaining the details, you could use a ContentControlOnExit macro to update the
    Document Property. You could even write code to add/delete such Document Properties via Content Controls, but I wouldn’t recommend it.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • What you seem to not recognise is that what you’re showing is not the Document Property itself but, at most, a reference to it. Of course, if you use a Content Control for maintaining the details, you could use a ContentControlOnExit macro to update the
    Document Property. You could even write code to add/delete such Document Properties via Content Controls, but I wouldn’t recommend it.


    Cheers
    Paul Edstein
    [MS MVP — Word]

         May I join this discussion by asking why nobody
    out there has written the code necessary to add, edit, and delete Document Properties via Content Controls?  This appears to be
    exactly what MGerio asked in the post that he added to this thread on Wednesday, August 1st, 2012 at 12:09 AM in clarifying his original question.  In fact, I need the code too because I need to link a ‘Teacher’ content control in the first
    page header of a short report that I am writing to a custom ‘Teacher’ document property associated with it because MLA style requires this.  Features like this should reside within Word’s standard UI! 

    P.S.:  I hope that the developers of Office 2013 are looking at this thread. 

  • I pointed to Greg Maxey’s site which has a lot of info on this general subject, but a more specific reference that may help you is

    http://www.gmayor.com/BookmarkandVariableEditor.htm

    Beyond that, one way of starting to think about the answer to your own question is to list the barriers that prevent you from creating the software you need. Then consider how much more difficult it might be to create something that is easy and reliable
    for other people to use.


    Peter Jamieson

  • Hi everybody,

    i have a similar issue i’ve been struggling with for quite a long time now, i will try to give you as detailed information as possible, so please excuse my excessive writing.

    I try to find a way to (automatically) enter user information (possibly from our AD) to a .docx concept template into fields or document properties or whatever possible. all of the fields reside on the front page, some of them are placed in the header and footer
    of the document.

    Up to now, my workaround is that i simply inserted document properties and customized them with different titles, tags and styles. the only problem is, that the user has to fill in all of them including going into the header and footer sections to reach some
    of the properties.

    This is what i either want to relocate to the properties section on the info tab, before working in the document, or that i want to be filled out automatically with user information from AD (of course excluding properties that only apply to the actual document
    like customer, project and so on).

    I want to keep the document free from macros and add-ins whenever possible.
    However, i did try vba and even tried some weird add-in and played around quite extensively with document properties and fields, but nothing worked for me the way that i wanted.

    I think it has to be somehow possible to create custom fields/document properties/whatever on the front page (including header & footer) where then, when opening the document, the first thing the user should do would be typing in his or her properties on
    the file tab —> info.
    There the user should be able to also fill in customized properties like «customer», «project name»or «type of document» without having to create custom properties each time they open the template document.

    Is that possible in any way? And if so, can this be done with just fields or with document properties? i’d like to have a different style attached to each property. For example, «customer» is big and bold, whereas telephone number and email are plain and simple.

    I’m no expert in directory services and also not in Word but i wonder why there’s no easier built-in way to reference customized document information or any possibility to automatically retrieve user information from Active Directory. I’m sure that lots of
    customers would be pleased to solve this without vba or third party add-ins..

    Again, sorry for the letter, i hope someone can share some ideas on this.

    Thanks,
    Stufe

  • Dear macropod,

    This is great option but, for some reason, this «DocProperty» acts as standard «CustomProperty» which is limited to 255 characters.

    If I use one of the «quick parts»—> «Document properties» such as «Manager, I can fill this property with Unlimited number of characters and also put some «Enters»…

    Is there any option to define this DocProperty to be able to filled with more than 255 characters?

    Thanks,

    Orion Lidji..

  • AFAIK, no — the limit is 255 characters.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • Hi guys,

    2 years later, and I’m trying to achieve exactly this. Thanks for your answers Peter, very interesting.

    Based on your posts and your link (http://gregmaxey.mvps.org/word_tip_pages/mapped_content_controls.html), I understand that it is possible to bind a Content Control only
    to a builtin Document Property. It is not possible to bind them to a Custom Document Property.

    One question: does anyone know if this has improved in Word 2013? Because the Content Control is so much userfriendly than {docproperty}/F9/and so on… And it is a little complex if I must have a Sharepoint server to be able to add metadata to my Word document…

  • As far as I know the situation is the same in 2013, i.e. the main differences in that version are to do with other aspects of content controls (new mapping UI, mapping of rich text controls, repeating groups). 


    Peter Jamieson

  • Ok thanks for your answer!

  • This is an excellent thread. I love how painstakingly and patiently mgerio walks through all replies and leads back to the original issue, time and time again — sometimes even using several replies. He will not be deterred or allow the thread to be repurposed
    or construed off topic! I love the informative and valuable replies by everyone, including Peter Jamieson (despite some oddities, IMNSHO). 

    Great summary of the need by RandomDSDevel. This is a could-have-been-fantastically-awesome-and-usable feature that stopped half-way, half-baked. Just opening that Quick Parts drop down makes me sad thinking of how good it could have been, the way I and
    many others thought it would work the first time we tried it out — so close… so close… :-)

  • hi, 

    i am not able to enter more than 255 character in value field. if any settings available let me know pls..

  • hi, 

    i am not able to enter more than 255 character in value field. if any settings available let me know pls..

    As has been pointed out in this thread, the maximum length of a custom document property is 255 characters. This cannot be changed.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • This one provides the most useful tool on the content control. Thanks a lot

  • Hi Hans
    Re: Custom Quick Parts ~ Do you know how the values are seen by other applications that use MetaData? Do these custom quick parts variables show up?

    I’d like to prepare files to be uploaded into a DMS, by creating a smart coversheet that contains meta data.
    The QuickParts are a great start but they don’t cover all the basics.  I was using Sharepoint as a DMS, but not anymore, the IT guys are thinking of procuring something else.  Thank you very much for any direction you can give.

  • I am not Hans, but (a) different types of property are stored in different ways, and (b) there are at least three possible ways to extract them, at least from a .docx:
     — Using the Word object model or .NET Interop, you can probably extract most, if not all of them, at least on Windows Word
     — You may still be able to extract the builtin properties and old-style Custom Document Porperties using the dsofile DLL (have a look around)
     — By digging around in the individual XML parts that make up a .docx file

    There may also be third-party libraries that will do those jobs for you, but I am not familiar with any of them.

    Using the Word object model, you can get at
     — the traditional built-in properties via a Document’s BuiltInDocumentProperties property

     — the traditional custom properties via a Document’s CustomDocumentProperties property

     — the «Cover Page Properties» by identifying the Custom XML Part that contains those properties and using XPath or other code to retrieve individual values.

     — *most* SharePoint type properties via a Document’s ContentTypeProperties collection property.

     — (if you take the view that Word Document Variables are «properties», you can get them via the Document’s Variables collection).

    The dsofile DLL is a Win32 DLL that let you retrieve builtin properties and old-style custom document properties. I don’t know what its status is now, and I doubt if it was ever expanded to include any other property types.

    If you want to get them straight from the .docx, a .docx is a .zip that contains its own file structure. You can unzip it and look at the individual .xml files, or use an API such as the .NET packaging API or the Office Open XML (OOXML) API to access the content.
    In principle, you have to discover the existence and location of each part using the [Content_Types].xml file in the .docx. In practice, documents created by Word always put the parts in the same folder structure within the file. But the broad-brush picture
    is that
     — the built-in properties are stored in 2 XML parts: core.xml and app.xml.
     — Old-style Custom document properties are stored in custom.xml.
     — Cover Page properties are stored in an itemsn.xml part in the CustomXml folder (e.g. items1.xml)
     — Sharepoint properties are stored in one or more itemsn.xml parts in the CustomXml folder, and a set of Sharepoint-generated XML schemas is stored in a nother part.
     — Document Variables are stored in the settings.xml part.

    If you have also to deal with .doc format  documents, you can access old-style properties as above. I forget what the situation as far as newer property types are concerned — AFAICR Sharepoint metaproperties are stored as old-style Custom-Document properties.
    Your best bet with .docs is probably to open them in interop, save them as .docx format, and use those to discover properties (unfortunately, that will change some of the date/time ones), even if you need to store the .doc rather than the .docx. In principle,
    it is possible to examine a .doc programmatically (that’s obviously what non-Microsoft converters do, so you may find useful libraries out there).


    Peter Jamieson

  • HI..

    What are shown here are not, exactly, document properties, I think. They are mapped content controls, for the most part mapped to document properties. You cannot add to this list or subtract from it. You can change the names of the properties. See Greg Maxey’s
    Repeating Data for information on how.

    The only one that I know is not a traditional document property that can be displayed with the DocProperty field is Abstract.

    Edit: Peter examines all of these in his spreadsheet. Abstract is not the only one in the document property list that is not a content control linked to a «document property» as that term has been used in the past. They are all mapped content controls
    and that does make them useful.


    Charles Kenyon Madison, WI

    • Edited by
      Charles Kenyon
      Thursday, March 10, 2016 2:52 PM

  • Charles:

    The items on the list will indeed insert content controls mapped to Document Properties, except for 5 which are mapped to a Custom XML Part containing Cover Page Properties, which is a namespace «known to» Word.

    AFAIK the only way to get anything else into the list is either to create Document Library/List columns in Sharepoint, and download adocument from that library. At that point, Sharepoint generates some more Custom XML Parts that (a) describe the metadata it
    has inserted (in the form of a few XML Schemas) and (b) contain the data. Word also recognises that stuff and generates new entries for the dropdown. Such data can also appear in the «Server Properties Document Information Panel», that is (or was
    — AIUI it has gone in Word 2016, but I haven’t looked) a pane displayed by some InfoPath code, and accessed through a Document’s «ContentTypeProperties» collection. SOme of my other posts in this conversation touch on some of these subjects.

    Strictly speaking, you do not need SharePoint to do that — as long as you create Custom XML Parts with the appropriate structures, Word will add entries to the list. But I do not think it can be recommended because of the issue of what happens if, for example,
    you create all your own SharePoint property data, then actually upload the document to a SharePoint folder with different property data.

    I don’t think Greg and Graham have ever (publicly) touched on the SharePoint side of things, but I am not particularly up-to-date with their material. As for the standard and cover page properties, they must have developed a list when developing one of their
    utilities. You might find my own list useful — it’s temporarily at

    https://www.dropbox.com/s/zt062h1i1hgwcbc/WordCoreExtendedCoverPageProperties.xlsx?dl=0

    and demonstrates a number of anomalies. I doubt if it is error-free!


    Peter Jamieson

    • Proposed as answer by
      Charles Kenyon
      Thursday, March 10, 2016 1:17 PM

  • Thank you Peter. Great Answer.

  • Thank you for sharing this Peter.

    Greg, in his Repeating Data page notes that it is possible to relabel these using the content control properties. That works very well if you want to do a quick and dirty mapped content control in a document or template. Here is a screenshot using a renamed
    Category document property.

    I wish very strongly that MS had not mixed up a bunch of stuff and put it under the label «Quick Parts.» What is done, is done.


    Charles Kenyon Madison, WI

  • A content control inserted using Quick Parts > Document Property > Author will look like that. A DocProperty field is what is described by Paul Edstein. This is an instance of Microsoft using the same term to describe related but different features.
    Some of the content controls inserted using Quick Parts > Document Property use document properties, others do not.

    So, the field {DocProperty Author} will reflect the content put in the Content Control. It will also show up if you look at the document properties pane. On the other hand, the Content Control for Abstract will not be reflected in any DocProperty field nor
    does it show up in the Document Properties pane.

    See the post by Peter.


    Charles Kenyon Madison, WI

  • Can document custom property be inserted, edited and look like this?

    No, but as explained in Greg Maxey’s
    Repeating Data (Populating Multiple Like Fields) these content controls inserted through Quick Parts > Document Property can be retitled and repurposed. Once you do that, you can copy it to another part of your document and it will replicate the content
    using the same title. The name in the drop-down list, though, will not change. If you change the title of Company to «Client» a copy of that content control will show the title «Client» but it will still be Company in the drop-down.


    Charles Kenyon Madison, WI

  • I Wonder..

    Engineer is not listed in default document property but I received a document with this doc property:

    How Do I create this?

    This is not a document property, but a Content Control. It may or may not be «mapped» to an XML node.
    Word Content Controls


    Charles Kenyon Madison, WI

  • hi, 

    i am not able to enter more than 255 character in value field. if any settings available let me know pls..

    The maximum length of a custom document property is 255 characters. The maximum length of a DocProperty field result appears to be the same. I do not know of a maximum length for a content control inserted using Quick Parts > Document Property. I have
    had it exceed a page in length. When that content control is inserted in another place, it holds all the original content whether inserted through the drop-down or through copy and paste.

    Using the Category content control from the Document Property list in Quick Parts I added a page of material that was reflected in the Category property on the Document Properties pane. However, the field {DocProperty Category} only gave 255 characters from
    it.

    Again, Microsoft is using the term «Document Property» to refer to different  Word features. The Quick Part refers to a Content Control that may be related to a document property.


    Charles Kenyon Madison, WI

Всем привет, помогите плиз.

Делаю печать документа Word. в нем заданы параметры через docVariable вида {DOCVARIABLE имя параметра * MARGEFORMAT}

Сам документ хранится в регистре сведений в ресурсе типа ХранилищеЗначения

Заполняю параметры следующим образом

МакетДокумента = Выборка.Хранилище.Получить();                

ИмяФайла = ПолучитьИмяВременногоФайла(«.doc»);

МакетДокумента.Записать(ИмяФайла);

            
MSWord = Новый COMОбъект(«Word.Application»);

MSWord.Documents.add(ИмяФайла);

            
ДокументВорд = MSWord.Application.Documents(1);

ДокументВорд.Activate();

            ДокументВорд.Variables.Item(«ТарифнаяСтавка»).Value = Выборка.ТарифнаяСтавка;

ДокументВорд.Fields.Update();

MSWord.ActiveWindow.View.ShowFieldCodes = False;

            
MSWord.Application.Visible = Истина;

MSWord.Activate();

            
УдалитьФайлы(ИмяФайла);

В результате открывается документ word и вместо подставленных параметров выходят надписи

«Ошибка! Неизвестное имя свойства документа.»

В чем может быть причина?

  • Remove From My Forums
  • Вопрос

  • Установлен Word 2007 в Windows 8. При загрузке документа с расширением doc в верхнем колонтитуле появляется ошибка, приведенная на скриншоте.

    Файл с ошибкой разместил по адресу:
    https://yadi.sk/d/853jRE6ic9boy

    Подскажите, пожалуйста, как исправить эту ошибку.


    Alex

    • Изменено

      20 октября 2014 г. 8:06

Ответы

  • В этом поле на колонтитуле нечетной страницы записан код, который видимо Word 2007 не может интерпретировать.
    Нажмите правой кнопкой мыши  на этом элементе Коды/значения полей. Отобразится код поля

    вида

    STYLEREF  "Header 1" n 

    Вам нужно изменить на русскую версию т.е.

    STYLEREF  "Оглавление 1" n 

    Затем снова переключаетесь в режим Значение полей и у вас должно отобразится

    Глава
    0  
    C. Ссылки  
    551

    Т.е. Поле STYLEREF , а свойство поля Оглавление 1. По кнопке «Изменить поле» можете даже изменять этот код.

    • Изменено
      Kirill Vakhrushev
      20 октября 2014 г. 16:29
    • Помечено в качестве ответа
      tumanovalex
      20 октября 2014 г. 16:58

У меня есть сайт MVC, который позволяет пользователям загружать текстовые документы, которые затем преобразуются в PDF. Эта часть работает нормально. Однако при просмотре документа PDF, встроенного в браузер, в верхней части документа отображается «Ошибка! Неизвестное имя свойства документа». Я понимаю, что это, возможно, является результатом того, что 1 или более свойств документа не установлены, но я не могу получить какое-либо из свойств через объект Document, возвращенный через Interop.

Я сохраняю поток байтов загруженного документа Word во временный каталог, чтобы облегчить преобразование PDF. «Файл» передается в качестве параметра.

  using (var tmpFileStream = File.OpenWrite(fileSavePath))
  {
      tmpFileStream.Write(file.BinaryBytes, 0, file.BinaryBytes.Length);
      tmpFileStream.Close();
  }

Затем я открываю документ, но когда я пытаюсь заполучить свойства и / или поля, все, что я получаю, это «COM-объект» в качестве значения.

 var applicationWord = new Application();
 var wordDoc = applicationWord.Documents.Open(fileSavePath);

 var properties = wordDoc.BuiltInDocumentProperties;
 var title = properties.Item("Title");
 var author = properties.Item("Author");

Я также попытался перебрать коллекцию Fields, чтобы увидеть, есть ли здесь что-нибудь, но тоже не было радости.

 foreach (var field in wordDoc.Fields)
 {
      var x = field.ToString();
 }

Я также вручную установил свойства целевого документа Word, например, заголовок, автор, но я все еще получил ту же ошибку.

Если у кого-то есть какие-либо идеи или, возможно, они сами решили эту проблему, я был бы очень признателен.

Я только что открыл документ Word в MS Word 2007, и перед номерами рисунков и таблиц появляется следующая ошибка:

Ошибка! Текст указанного стиля отсутствует в документе

Код названия фигуры / таблицы (после нажатия alt-F9) выглядит так:

Table {STYLEREF 1s},{SEQ Table* ARABICs 1}

Эта ошибка отсутствовала, когда я работал над файлом ранее, и я являюсь единственным пользователем файла.

Почему происходит эта ошибка и каков наилучший способ ее устранения?

{STYLEREF 1} ищет абзац со встроенным стилем «Заголовок 1» (в англоязычных версиях Word — если вы используете версию на другом языке, стили заголовков могут называться по-разному).

Поэтому, если у вас нет ни одного из них, поле {STYLEREF} будет отмечать ошибку, которую вы видите.

Еще один способ исправить это — вставить отформатированную строку заголовка 1 как скрытый текст. Ошибка исчезнет. Я использовал «Скрытый заголовок 1», чтобы помнить, почему он там был. Работает на Word 2016.

Понравилась статья? Поделить с друзьями:
  • Ошибка неверный формат данных excel
  • Ошибка неверно указана единица измерения word как убрать
  • Ошибка не могу запустить excel
  • Ошибка н д в excel при впр как убрать
  • Ошибка макросы для excel