Using MOSS 2007 Fields in VBA - Word 2007

A

Adrian Graves

Hi,

I have documents in a MOSS 2007 Document Library that has content approval
and versioning enabled. I have two issues:

1. I want to display MOSS 2007 Document Version Information and insert it
into a content control text box (or some other type of container?)

I have figured out how to retrieve the version information, but how would I
insert it into a txt box?

Here's the code I use to get the version number of the document:

Dim dlvVersions As Office.DocumentLibraryVersions
Dim strVersionInfo As String
Set dlvVersions = ActiveDocument.DocumentLibraryVersions
strDocVersion = dlvVersions.Count

2. The second issue is I would like to add either text to the header of the
document or add in a watermark if the document is a checked out version. The
idea would be to have UNCONTROLLED DOCUMENT or something similair displayed
on any unapproved document.

Something like this would be good:

Private Sub Document_Open()
If ApprovalStatus = "CheckedOut"
display watermark or insert text into header
End If
End Sub

Any help would be greatly appreciated.

Regards,

Adrian
 
A

Adrian Graves

I have part 1 of the issue solved by doing this:

Dim dlvVersions As Office.DocumentLibraryVersions
Dim strDocVersion As String
Set dlvVersions = ActiveDocument.DocumentLibraryVersions
strDocVersion = dlvVersions.Count
ActiveDocument.FormFields("Text1").Result = strDocVersion

Which works very well. The second part of my problem still alludes me
though :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top