Hi,
I'm having trouble displaying information from a variety of Word constants:
For instance:
PageNumber = Selection.Information(wdActiveEndPageNumber)
MsgBox (PageNumber)
works OK but:
DocTitle = ActiveDocument.Fields(wdFieldTitle).Result
MsgBox (DocTitle)
returns a message saying that the member of the Collection does not exist.
Doing:
DocTitle = ActiveDocument.Fields.Count
MsgBox (DocTitle)
returns a 1 after Inserting a Field of type Title into the document. This seems to indicate that the wdFieldType Word constants do not have values until they are inserted into the document. Is this correct?
I would like to know how to assign the text in the Title property of the document to a variable, which I may then display. How is this achieved?
Many thanks,
Ian P.
I'm having trouble displaying information from a variety of Word constants:
For instance:
PageNumber = Selection.Information(wdActiveEndPageNumber)
MsgBox (PageNumber)
works OK but:
DocTitle = ActiveDocument.Fields(wdFieldTitle).Result
MsgBox (DocTitle)
returns a message saying that the member of the Collection does not exist.
Doing:
DocTitle = ActiveDocument.Fields.Count
MsgBox (DocTitle)
returns a 1 after Inserting a Field of type Title into the document. This seems to indicate that the wdFieldType Word constants do not have values until they are inserted into the document. Is this correct?
I would like to know how to assign the text in the Title property of the document to a variable, which I may then display. How is this achieved?
Many thanks,
Ian P.