A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

ODMA Doc ID Field



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2004, 03:25 AM
Julie
external usenet poster
 
Posts: n/a
Default ODMA Doc ID Field

Hi - I am using Word 03 with DocsOpen which is a document
management system. I have created a macro that puts the
document number in the footer of the document using the
ODMA Doc ID field found under Insert, Field,
DocProperties. The macro cleans up the Doc Id so it just
displays the doc number and version number:

Like this: 587298.1
Instead of : ODMA::blablabla/587298.1

Works great, except when I print, the ODMA junk comes
back. I do not have my fields updating when I print
(under tools, options).

I tried to recreate the macro so it cuts the number and
then does a paste special unformatted so it wouldn't be a
field anymore, but the macro code doesn't work.

Can anybody help?? Thanks!
  #2  
Old May 4th, 2004, 09:37 AM
Peter Jamieson
external usenet poster
 
Posts: n/a
Default ODMA Doc ID Field

Suggestions:
a. lock the field, e.g. add

yourfieldobject.Locked = True

(could be Selection.Fields.Locked = True)
after you have modified the field result. You may need to unlock it before
modifying it. Or..
b. create your own Custom Document Property and put your derived value in
there, then use a { DOCPROPERTY myproperty } field to insert it. Or use a
document variable and a { DOCVARIABLE } field. Or..
c. post the existing macro code here and perhaps we can suggest a tweak.


--
Peter Jamieson

"Julie" wrote in message
...
Hi - I am using Word 03 with DocsOpen which is a document
management system. I have created a macro that puts the
document number in the footer of the document using the
ODMA Doc ID field found under Insert, Field,
DocProperties. The macro cleans up the Doc Id so it just
displays the doc number and version number:

Like this: 587298.1
Instead of : ODMA::blablabla/587298.1

Works great, except when I print, the ODMA junk comes
back. I do not have my fields updating when I print
(under tools, options).

I tried to recreate the macro so it cuts the number and
then does a paste special unformatted so it wouldn't be a
field anymore, but the macro code doesn't work.

Can anybody help?? Thanks!



  #3  
Old May 4th, 2004, 06:17 PM
Julie
external usenet poster
 
Posts: n/a
Default ODMA Doc ID Field

Thanks Peter, I appreciate it. YES I want to lock the
field after it's been formatted. I put a new statement to
test it with the Filename field, my original statement for
the ODMA field is in as a comment for now. Can't quite
figure out where to put the locked statement.

Here's my code:


Sub StampInFooter()

'
' FileStamp Macro
' Macro recorded February 16, 2004 by
'
If Documents.Count = 0 Then Exit Sub


' Numinftr Macro
' Macro recorded 4/22/2004 by jstein
'
If ActiveWindow.View.SplitSpecial wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument

If ActiveWindow.View.SplitSpecial wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
End If


With ActiveDocument.PageSetup
.DifferentFirstPageHeaderFooter = False
End With
Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, Text:= _
"FILENAME \* Caps \p ", PreserveFormatting:=True

'Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, Text:= _
' "DOCPROPERTY ODMADocId ",
PreserveFormatting:=True

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "\"
.Replacement.Text = "."
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = ":"
.Replacement.Text = "."
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.TypeBackspace

Selection.EndKey Unit:=wdLine, Extend:=wdExtend
With Selection.Font
.Name = "Times New Roman"
.Size = 8
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
End With

Selection.Fields.Locked = True

With ActiveDocument.PageSetup
.DifferentFirstPageHeaderFooter = True
End With
With Selection.Find
.Forward = True

End With


ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
End Sub


-----------------------------

Sorry so long, and thanks for the help.

Julie



-----Original Message-----
Suggestions:
a. lock the field, e.g. add

yourfieldobject.Locked = True

(could be Selection.Fields.Locked = True)
after you have modified the field result. You may need to

unlock it before
modifying it. Or..
b. create your own Custom Document Property and put your

derived value in
there, then use a { DOCPROPERTY myproperty } field to

insert it. Or use a
document variable and a { DOCVARIABLE } field. Or..
c. post the existing macro code here and perhaps we can

suggest a tweak.


--
Peter Jamieson

"Julie" wrote in

message
...
Hi - I am using Word 03 with DocsOpen which is a

document
management system. I have created a macro that puts the
document number in the footer of the document using the
ODMA Doc ID field found under Insert, Field,
DocProperties. The macro cleans up the Doc Id so it

just
displays the doc number and version number:

Like this: 587298.1
Instead of : ODMA::blablabla/587298.1

Works great, except when I print, the ODMA junk comes
back. I do not have my fields updating when I print
(under tools, options).

I tried to recreate the macro so it cuts the number and
then does a paste special unformatted so it wouldn't be

a
field anymore, but the macro code doesn't work.

Can anybody help?? Thanks!



.

  #4  
Old May 4th, 2004, 07:28 PM
Peter Jamieson
external usenet poster
 
Posts: n/a
Default ODMA Doc ID Field

OK, you have

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"FILENAME \* Caps \p ", PreserveFormatting:=True

and after that, commented out, you have

'Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
' "DOCPROPERTY ODMADocId ", PreserveFormatting:=True

From what you have said, maybe the DOCPROPERTY field insertion should not be
commented out. Either way, try adding the following statement afterwards:

Selection.Fields.Locked = True

--
Peter Jamieson

"Julie" wrote in message
...
Thanks Peter, I appreciate it. YES I want to lock the
field after it's been formatted. I put a new statement to
test it with the Filename field, my original statement for
the ODMA field is in as a comment for now. Can't quite
figure out where to put the locked statement.

Here's my code:


Sub StampInFooter()

'
' FileStamp Macro
' Macro recorded February 16, 2004 by
'
If Documents.Count = 0 Then Exit Sub


' Numinftr Macro
' Macro recorded 4/22/2004 by jstein
'
If ActiveWindow.View.SplitSpecial wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument

If ActiveWindow.View.SplitSpecial wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
End If


With ActiveDocument.PageSetup
.DifferentFirstPageHeaderFooter = False
End With
Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, Text:= _
"FILENAME \* Caps \p ", PreserveFormatting:=True

'Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, Text:= _
' "DOCPROPERTY ODMADocId ",
PreserveFormatting:=True

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "\"
.Replacement.Text = "."
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = ":"
.Replacement.Text = "."
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.TypeBackspace

Selection.EndKey Unit:=wdLine, Extend:=wdExtend
With Selection.Font
.Name = "Times New Roman"
.Size = 8
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
End With

Selection.Fields.Locked = True

With ActiveDocument.PageSetup
.DifferentFirstPageHeaderFooter = True
End With
With Selection.Find
.Forward = True

End With


ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
End Sub


-----------------------------

Sorry so long, and thanks for the help.

Julie



-----Original Message-----
Suggestions:
a. lock the field, e.g. add

yourfieldobject.Locked = True

(could be Selection.Fields.Locked = True)
after you have modified the field result. You may need to

unlock it before
modifying it. Or..
b. create your own Custom Document Property and put your

derived value in
there, then use a { DOCPROPERTY myproperty } field to

insert it. Or use a
document variable and a { DOCVARIABLE } field. Or..
c. post the existing macro code here and perhaps we can

suggest a tweak.


--
Peter Jamieson

"Julie" wrote in

message
...
Hi - I am using Word 03 with DocsOpen which is a

document
management system. I have created a macro that puts the
document number in the footer of the document using the
ODMA Doc ID field found under Insert, Field,
DocProperties. The macro cleans up the Doc Id so it

just
displays the doc number and version number:

Like this: 587298.1
Instead of : ODMA::blablabla/587298.1

Works great, except when I print, the ODMA junk comes
back. I do not have my fields updating when I print
(under tools, options).

I tried to recreate the macro so it cuts the number and
then does a paste special unformatted so it wouldn't be

a
field anymore, but the macro code doesn't work.

Can anybody help?? Thanks!



.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:44 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.