Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
piersonal piersonal is offline
external usenet poster
 
Posts: 9
Default How do content control fields work?

I am trying to compile a template document for new proposals and in some
downloaded templates I see the excellent use of Content Control fields. I
want the user to be able to enter the customer name once at the beginning and
for this data to be replicated in the header and other areas of the document
and Content Control seems to be the answer.

But I can't seem to make this work. Anyone know how to reference the
information in a Content Control? The Properties dialog box seems to omit
important info, like the field name for starters ...

All very confusing!!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How do content control fields work?

See http://gregmaxey.mvps.org/Repeating_Data.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


piersonal wrote:
I am trying to compile a template document for new proposals and in
some downloaded templates I see the excellent use of Content Control
fields. I want the user to be able to enter the customer name once at
the beginning and for this data to be replicated in the header and
other areas of the document and Content Control seems to be the
answer.

But I can't seem to make this work. Anyone know how to reference the
information in a Content Control? The Properties dialog box seems to
omit important info, like the field name for starters ...

All very confusing!!



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How do content control fields work?

Has Greg added material on Content Controls (new in Word 2007)?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Graham Mayor" wrote in message
...
See http://gregmaxey.mvps.org/Repeating_Data.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


piersonal wrote:
I am trying to compile a template document for new proposals and in
some downloaded templates I see the excellent use of Content Control
fields. I want the user to be able to enter the customer name once at
the beginning and for this data to be replicated in the header and
other areas of the document and Content Control seems to be the
answer.

But I can't seem to make this work. Anyone know how to reference the
information in a Content Control? The Properties dialog box seems to
omit important info, like the field name for starters ...

All very confusing!!




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Dawn Crosier, Word MVP Dawn Crosier, Word MVP is offline
external usenet poster
 
Posts: 425
Default How do content control fields work?

This article may help to shed some light:

http://blogs.msdn.com/microsoft_offi...yet-equal.aspx

--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message was posted to a newsgroup, Please post replies and questions
to the group so that others can learn as well.
"piersonal" wrote in message
...
I am trying to compile a template document for new proposals and in some
downloaded templates I see the excellent use of Content Control fields. I
want the user to be able to enter the customer name once at the beginning
and
for this data to be replicated in the header and other areas of the document
and Content Control seems to be the answer.

But I can't seem to make this work. Anyone know how to reference the
information in a Content Control? The Properties dialog box seems to omit
important info, like the field name for starters ...

All very confusing!!


  #5   Report Post  
Posted to microsoft.public.word.docmanagement
piersonal piersonal is offline
external usenet poster
 
Posts: 9
Default How do content control fields work?

Many thanks for this Graham but like Suzanne says, this doesn't actually
answer the question. Forms and bookmarks and the like are all great, but
Content Control which is new in v2007 seems to be exactly what I was looking
for but is not very well documented / seems frustratingly limited.

Is anyone out there able to help explain this feature??


  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 264
Default How do content control fields work?

Suzanne,

No I haven't. I looked into doing that a few months ago but quit when
I found bum dope in the MSDN technical article on Content Controls.
When first created CCs apparently could have a unique name (or tag).
I suppose through changes in development the name and tag are no
longer unique to the CC. I was hoping this would be corrected (the
article and the issue) before the public release. It wasn't. I am
not at my Word2007 machine right now, but if memory serves the CC has
a unique ID number that you can determine through VBA and then use it
is a reference. I will check tonight and perhaps post some updated
information on my web page.


On Mar 28, 11:01 am, "Suzanne S. Barnhill" wrote:
Has Greg added material on Content Controls (new in Word 2007)?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site:http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Graham Mayor" wrote in message

...



Seehttp://gregmaxey.mvps.org/Repeating_Data.htm


--

Graham Mayor - Word MVP


My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


piersonal wrote:
I am trying to compile a template document for new proposals and in
some downloaded templates I see the excellent use of Content Control
fields. I want the user to be able to enter the customer name once at
the beginning and for this data to be replicated in the header and
other areas of the document and Content Control seems to be the
answer.


But I can't seem to make this work. Anyone know how to reference the
information in a Content Control? The Properties dialog box seems to
omit important info, like the field name for starters ...


All very confusing!!- Hide quoted text -


- Show quoted text -



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
piersonal piersonal is offline
external usenet poster
 
Posts: 9
Default How do content control fields work?

The sites make really good reading thank you. The one main question that I
had was with how to reference a Content Control. A template that I downloaded
had a Content Control for the Title, which was repeated on the next page.
Update one and the other would update.

This is good for existing Property fields, but can we create custom ones? I
want to have users enter the customer name on the front page (into a Content
Control) and to have this information repeated in other areas, but I cannot
for the life of me figure out how to do this.
  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Dawn Crosier, Word MVP Dawn Crosier, Word MVP is offline
external usenet poster
 
Posts: 425
Default How do content control fields work?

Yes, you can create custom properties. I was shown, but have not had a
chance to work up the steps. Perhaps Graham will get some time this evening.
If he doesn't then I will see what I can come up with. XML is NOT my strong
suit by any stretch of the means. sigh

--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message was posted to a newsgroup, Please post replies and questions
to the group so that others can learn as well.
"piersonal" wrote in message
...
The sites make really good reading thank you. The one main question that I
had was with how to reference a Content Control. A template that I
downloaded
had a Content Control for the Title, which was repeated on the next page.
Update one and the other would update.

This is good for existing Property fields, but can we create custom ones? I
want to have users enter the customer name on the front page (into a Content
Control) and to have this information repeated in other areas, but I cannot
for the life of me figure out how to do this.


  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 285
Default How do content control fields work?

Here is one way and I am working on others to update my website:

Use the Document_ContentConrolOnExit event to write the text value of the
current Content Control to a custom document property. Then use DocProperty
fields at the other location in your document to repeat the data:

Private Sub Document_ContentControlOnExit(ByVal currentCC As ContentControl,
Cancel As Boolean)
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
Select Case currentCC.Title
Case "Client_Name"
On Error Resume Next
oDoc.CustomDocumentProperties("Client_Name").Value =
currentCC.Range.Text
If Err.Number = 5 Then
oDoc.CustomDocumentProperties.Add _
Name:="Client_Name", LinkToContent:=False,
Value:=currentCC.Range.Text, _
Type:=msoPropertyTypeString
End If
On Error GoTo 0
Case Else
'Do nothing
End Select
UpdateDocumentFields
End Sub
Sub UpdateDocumentFields()
Dim pRange As Word.Range
Dim iLink As Long
iLink = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


piersonal wrote:
The sites make really good reading thank you. The one main question
that I had was with how to reference a Content Control. A template
that I downloaded had a Content Control for the Title, which was
repeated on the next page. Update one and the other would update.

This is good for existing Property fields, but can we create custom
ones? I want to have users enter the customer name on the front page
(into a Content Control) and to have this information repeated in
other areas, but I cannot for the life of me figure out how to do
this.



  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How do content control fields work?

Greg and I have the same initials, we have been friends for years, we both
have Word related web sites and both bounce ideas off one another - but we
are not the same person

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Dawn Crosier, Word MVP wrote:
Yes, you can create custom properties. I was shown, but have not had a
chance to work up the steps. Perhaps Graham will get some time this
evening. If he doesn't then I will see what I can come up with. XML
is NOT my strong suit by any stretch of the means. sigh





  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Pamela Denchfield Pamela Denchfield is offline
external usenet poster
 
Posts: 19
Default How do content control fields work?

Is there a way to incorporate the auto-updated content controls without
resorting to VBA or other coding? The templates freely downloaded from Office
Online seem to have these already incorporated, dependent on standard
document properties. It would be nice if I could create these myself, too.
--
Thanks,
Pamela Denchfield


"Greg Maxey" wrote:

Here is one way and I am working on others to update my website:

Use the Document_ContentConrolOnExit event to write the text value of the
current Content Control to a custom document property. Then use DocProperty
fields at the other location in your document to repeat the data:

Private Sub Document_ContentControlOnExit(ByVal currentCC As ContentControl,
Cancel As Boolean)
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
Select Case currentCC.Title
Case "Client_Name"
On Error Resume Next
oDoc.CustomDocumentProperties("Client_Name").Value =
currentCC.Range.Text
If Err.Number = 5 Then
oDoc.CustomDocumentProperties.Add _
Name:="Client_Name", LinkToContent:=False,
Value:=currentCC.Range.Text, _
Type:=msoPropertyTypeString
End If
On Error GoTo 0
Case Else
'Do nothing
End Select
UpdateDocumentFields
End Sub
Sub UpdateDocumentFields()
Dim pRange As Word.Range
Dim iLink As Long
iLink = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


piersonal wrote:
The sites make really good reading thank you. The one main question
that I had was with how to reference a Content Control. A template
that I downloaded had a Content Control for the Title, which was
repeated on the next page. Update one and the other would update.

This is good for existing Property fields, but can we create custom
ones? I want to have users enter the customer name on the front page
(into a Content Control) and to have this information repeated in
other areas, but I cannot for the life of me figure out how to do
this.




  #12   Report Post  
Posted to microsoft.public.word.docmanagement
Pamela Denchfield Pamela Denchfield is offline
external usenet poster
 
Posts: 19
Default How do content control fields work?

Hi again Greg, just read your webpage
http://gregmaxey.mvps.org/Repeating_Data.htm - the following excerpt implies
that I am indeed limited to the built-in (factory default) Document Property
content controls if I want to "repeat data" without coding. Am I right?

"A very simple method of repeating data in a Word2007 document without
knowledge of any XML or VBA is to use the built-in Document Property content
controls. "
--
Thanks,
Pamela Denchfield


"Pamela Denchfield" wrote:

Is there a way to incorporate the auto-updated content controls without
resorting to VBA or other coding? The templates freely downloaded from Office
Online seem to have these already incorporated, dependent on standard
document properties. It would be nice if I could create these myself, too.
--
Thanks,
Pamela Denchfield


"Greg Maxey" wrote:

Here is one way and I am working on others to update my website:

Use the Document_ContentConrolOnExit event to write the text value of the
current Content Control to a custom document property. Then use DocProperty
fields at the other location in your document to repeat the data:

Private Sub Document_ContentControlOnExit(ByVal currentCC As ContentControl,
Cancel As Boolean)
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
Select Case currentCC.Title
Case "Client_Name"
On Error Resume Next
oDoc.CustomDocumentProperties("Client_Name").Value =
currentCC.Range.Text
If Err.Number = 5 Then
oDoc.CustomDocumentProperties.Add _
Name:="Client_Name", LinkToContent:=False,
Value:=currentCC.Range.Text, _
Type:=msoPropertyTypeString
End If
On Error GoTo 0
Case Else
'Do nothing
End Select
UpdateDocumentFields
End Sub
Sub UpdateDocumentFields()
Dim pRange As Word.Range
Dim iLink As Long
iLink = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


piersonal wrote:
The sites make really good reading thank you. The one main question
that I had was with how to reference a Content Control. A template
that I downloaded had a Content Control for the Title, which was
repeated on the next page. Update one and the other would update.

This is good for existing Property fields, but can we create custom
ones? I want to have users enter the customer name on the front page
(into a Content Control) and to have this information repeated in
other areas, but I cannot for the life of me figure out how to do
this.




  #13   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 285
Default How do content control fields work?

Pamela,

I still don't claim to be an expert with Content Controls or even a Pioneer.
Let's say a stumbling Pioneer ;-)

You can always bookmark a ContentControl range and use a REF field to that
bookmark. Other than that AFAIK, it is the built-ins with the limit they
carry or some VBA coding. The piece stating with 7.c. is really the way to
go and the coding is relatively simple.


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Pamela Denchfield wrote:
Hi again Greg, just read your webpage
http://gregmaxey.mvps.org/Repeating_Data.htm - the following excerpt
implies that I am indeed limited to the built-in (factory default)
Document Property content controls if I want to "repeat data" without
coding. Am I right?

"A very simple method of repeating data in a Word2007 document without
knowledge of any XML or VBA is to use the built-in Document Property
content controls. "

Is there a way to incorporate the auto-updated content controls
without resorting to VBA or other coding? The templates freely
downloaded from Office Online seem to have these already
incorporated, dependent on standard document properties. It would be
nice if I could create these myself, too. --
Thanks,
Pamela Denchfield


"Greg Maxey" wrote:

Here is one way and I am working on others to update my website:

Use the Document_ContentConrolOnExit event to write the text value
of the current Content Control to a custom document property. Then
use DocProperty fields at the other location in your document to
repeat the data:

Private Sub Document_ContentControlOnExit(ByVal currentCC As
ContentControl, Cancel As Boolean)
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
Select Case currentCC.Title
Case "Client_Name"
On Error Resume Next
oDoc.CustomDocumentProperties("Client_Name").Value =
currentCC.Range.Text
If Err.Number = 5 Then
oDoc.CustomDocumentProperties.Add _
Name:="Client_Name", LinkToContent:=False,
Value:=currentCC.Range.Text, _
Type:=msoPropertyTypeString
End If
On Error GoTo 0
Case Else
'Do nothing
End Select
UpdateDocumentFields
End Sub
Sub UpdateDocumentFields()
Dim pRange As Word.Range
Dim iLink As Long
iLink = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


piersonal wrote:
The sites make really good reading thank you. The one main question
that I had was with how to reference a Content Control. A template
that I downloaded had a Content Control for the Title, which was
repeated on the next page. Update one and the other would update.

This is good for existing Property fields, but can we create custom
ones? I want to have users enter the customer name on the front
page (into a Content Control) and to have this information
repeated in other areas, but I cannot for the life of me figure
out how to do this.



  #14   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 264
Default How do content control fields work?

On Dec 18, 4:56 pm, Pamela Denchfield wrote:
Is there a way to incorporate the auto-updated content controls without
resorting to VBA or other coding? The templates freely downloaded from Office
Online seem to have these already incorporated, dependent on standard
document properties. It would be nice if I could create these myself, too.
--
Thanks,
Pamela Denchfield



"Greg Maxey" wrote:
Here is one way and I am working on others to update my website:


Use the Document_ContentConrolOnExit event to write the text value of the
current Content Control to a custom document property. Then use DocProperty
fields at the other location in your document to repeat the data:


Private Sub Document_ContentControlOnExit(ByVal currentCC As ContentControl,
Cancel As Boolean)
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
Select Case currentCC.Title
Case "Client_Name"
On Error Resume Next
oDoc.CustomDocumentProperties("Client_Name").Value =
currentCC.Range.Text
If Err.Number = 5 Then
oDoc.CustomDocumentProperties.Add _
Name:="Client_Name", LinkToContent:=False,
Value:=currentCC.Range.Text, _
Type:=msoPropertyTypeString
End If
On Error GoTo 0
Case Else
'Do nothing
End Select
UpdateDocumentFields
End Sub
Sub UpdateDocumentFields()
Dim pRange As Word.Range
Dim iLink As Long
iLink = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


piersonal wrote:
The sites make really good reading thank you. The one main question
that I had was with how to reference a Content Control. A template
that I downloaded had a Content Control for the Title, which was
repeated on the next page. Update one and the other would update.


This is good for existing Property fields, but can we create custom
ones? I want to have users enter the customer name on the front page
(into a Content Control) and to have this information repeated in
other areas, but I cannot for the life of me figure out how to do
this.- Hide quoted text -


- Show quoted text -


Pamela,

I experimented today with creating and AddIn that would allow a user
to insert multiple custom mapped CCs seemingly effortless and without
needing to do any VBA or XML coding. I want to refine it a bit before
I post it to my website but if you contact me through the website
feedback I will share it with you now.
  #15   Report Post  
Posted to microsoft.public.word.docmanagement
Pamela Denchfield Pamela Denchfield is offline
external usenet poster
 
Posts: 19
Default How do content control fields work?

I appreciate the add-in and look forward to trying it out on my next template
project!
--
Thanks,
Pamela Denchfield


"Greg Maxey" wrote:

On Dec 18, 4:56 pm, Pamela Denchfield wrote:
Is there a way to incorporate the auto-updated content controls without
resorting to VBA or other coding? The templates freely downloaded from Office
Online seem to have these already incorporated, dependent on standard
document properties. It would be nice if I could create these myself, too.
--
Thanks,
Pamela Denchfield



"Greg Maxey" wrote:
Here is one way and I am working on others to update my website:


Use the Document_ContentConrolOnExit event to write the text value of the
current Content Control to a custom document property. Then use DocProperty
fields at the other location in your document to repeat the data:


Private Sub Document_ContentControlOnExit(ByVal currentCC As ContentControl,
Cancel As Boolean)
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
Select Case currentCC.Title
Case "Client_Name"
On Error Resume Next
oDoc.CustomDocumentProperties("Client_Name").Value =
currentCC.Range.Text
If Err.Number = 5 Then
oDoc.CustomDocumentProperties.Add _
Name:="Client_Name", LinkToContent:=False,
Value:=currentCC.Range.Text, _
Type:=msoPropertyTypeString
End If
On Error GoTo 0
Case Else
'Do nothing
End Select
UpdateDocumentFields
End Sub
Sub UpdateDocumentFields()
Dim pRange As Word.Range
Dim iLink As Long
iLink = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


piersonal wrote:
The sites make really good reading thank you. The one main question
that I had was with how to reference a Content Control. A template
that I downloaded had a Content Control for the Title, which was
repeated on the next page. Update one and the other would update.


This is good for existing Property fields, but can we create custom
ones? I want to have users enter the customer name on the front page
(into a Content Control) and to have this information repeated in
other areas, but I cannot for the life of me figure out how to do
this.- Hide quoted text -


- Show quoted text -


Pamela,

I experimented today with creating and AddIn that would allow a user
to insert multiple custom mapped CCs seemingly effortless and without
needing to do any VBA or XML coding. I want to refine it a bit before
I post it to my website but if you contact me through the website
feedback I will share it with you now.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Control Titles Vanishing jwwegner Microsoft Word Help 1 March 24th 07 01:50 AM
What is a Tag in the Content Control Properties dialog box? cmc Microsoft Word Help 1 March 17th 07 12:26 AM
form content disappears with select-all/update fields Barbara White Microsoft Word Help 6 February 9th 07 10:17 PM
Control key shortcuts do not work DDK Microsoft Word Help 1 April 13th 05 05:35 PM
How do I make the Table of Content link work? Lei Microsoft Word Help 2 January 17th 05 10:51 PM


All times are GMT +1. The time now is 11:18 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"