Mojo said:
Hi All
Just wondered if anybody has a definitive list of allowable chars for
WordBasic's .SetDocumentProperty "Title" property.
Adding a title works fine with alphanumeric chars but I'd like to use
other
chars to break up the text, eg Report 12-5-10 instead of Report 12510.
Hyphens seem to be out, but I didn't know if there was anyway round this??
Hi Mojo,
Not quite sure, but I think any (Unicode) character should be allowed in the
file name except for
\/:*?"<>|
.... unless maybe if you're using some very ancient Word/Windows versions.
Certainly the hyphen should make no problem.
What code do you use? Do you use WordBasic because you're editing some
ancient Word 6 macros?
The code should look something like this:
WordBasic.SetDocumentProperty "Title", 0, "Report 12-5-10 ", 1
Or if you move to VBA:
ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle)="Report 12-5-10"
I've pasted the topic from the old WordBasic help file below, so you can see
what the arguments are.
Regards,
Klaus
~~~~~~~~~~~~~~~~~~
SetDocumentProperty Name$, Type, Value[$], CustomOrBuiltIn
Defines a document property for the active document. If Name$ is a built-in
property that doesn't match the type specified by Type, or if it is a
read-only property, an error occurs. Use the DocumentPropertyExists()
function to determine whether a property called Name$ already exists.
For a list of the built-in properties available in Word, see
DocumentPropertyName$(). In Word version 6.0, SetDocumentProperty is
unavailable and generates an error.
Argument Explanation
Name$ The name of the property. Name$ can be a built-in property or a custom
property.
Type The type of the property to be defined:0 (zero) String1 Number2
Date3 Yes or NoIf Name$ is a built-in property and doesn't match the type
specified by Type, an error occurs.
Value[$] The property value. Value[$] must match the type specified by
Type.If Value[$] doesn't match the type specified by Type, an error occurs.
CustomOrBuiltIn Specifies whether Name$ is a custom property or a built-in
property:0 (zero) or omitted Name$ is a custom property unless it appears
in the list of built-in properties. If Name$ is a built-in property,
SetDocumentProperty will update its value.1 Name$ is a built-in property. If
it is not one of the built-in properties, an error occurs. 2 Name$ is a
custom property, regardless of whether a built-in property with the same
name already exists.