![]() |
|
#1
|
||||
|
||||
![]() Rather than using the VBA code listed in the "Advanced Custom Mapping" section, you might want to read a little further on and go to the 'Content Control Tools' page and download the addin there. A simpler alternative would be to use a ContentControlOnExit macro in the 'ThisDocument' code module of either the document or its template, coded along the lines of: Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean) If CCtrl.Title <> "Parent" Then Exit Sub With CCtrl If .ShowingPlaceholderText = False Then ActiveDocument.SelectContentControlsByTitle("Child")(1).Range.Text = .Range.Text Else ActiveDocument.SelectContentControlsByTitle("Child")(1).Range.Text = "XXXX" End If End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Sorry, I'm not sure I follow what you mean by "Parent" and "Child". But I was able to accomplish what I wanted using one of the predefined document types ("Company").
Is this enough information to construct the pdf macro, or do I need to implement the VBA code you provided first? |
#3
|
||||
|
||||
![]()
As indicated in my previous reply, those are content control titles that you can add via Developer|Controls>Properties, after selecting the appropriate content control.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
![]()
I opened the property list. Each has a "(Name)" and "ThisDocument" attribute. The list is rather long, and I'm unsure if I need to be using to them.
I would assume the next step would be to create a macro for saving a pdf using the filename convention discussed in my original post. If we know I'm using the built-in "Company" control type for the "Lorem Ipsum" text in the filename, is there a way to grab that for the macro? |
#5
|
||||
|
||||
![]() Quote:
Quote:
That's not the issue. The issue is the content replication. In any event, it's unwise to repurpose a built-in content control the way you propose.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
![]()
Sorry if I'm not understanding - I am completely new to content controls - but what exactly is it that you need me to do at this point? I have my "Lorem ipsum" text replicating throughout the document as needed now. That solves the second part of my two-part issue in the original post, I think.
Now I just need to know how to write a pdf-save macro that saves the filename according to some boilerplate text at the front, my "Lorem ipsum" text currently being used with a content control, and the computer's internal date. Am I missing something? Am I skipping a step? Apologies for all the questions. |
![]() |
Tags |
pdf export |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
brent chadwick | Word VBA | 10 | 10-25-2017 08:26 AM |
How to save the current page in a new file with all the page settings (header, footer | Jamal NUMAN | Word | 6 | 03-15-2012 03:27 PM |
![]() |
KIM SOLIS | Excel | 2 | 11-04-2011 06:09 PM |
![]() |
jabberwocky12 | Word VBA | 2 | 10-22-2010 12:23 PM |
![]() |
Styler001 | Word | 4 | 01-25-2010 06:40 PM |