Needhelp!!!
12-18-2012, 11:43 AM
Hi,
I am creating a form, and I need help with my VBA Code. (Code is below) I can't get it to work. I am an amateur at this, so please, any help is appreciated. I think the problem lies in between the "Private Sub Document_Open() and the End Sub. How do I make the transition from opening the document to telling the document not to print placeholders in content control when the document is printed??
Private Sub Document_Open()
End Sub
Sub FilePrint()
Dim cc As ContentControl
Dim col As Long
With ActiveDocument
' hide placeholders
For Each cc In .ContentControls
If cc.ShowingPlaceholderText Then
col = cc.Range.Font.Color
cc.Range.Font.Color = wdColorWhite
End If
Next
Dialogs(wdDialogFilePrint).Show
For Each cc In .ContentControls
If cc.ShowingPlaceholderText Then
cc.Range.Font.Color = col
End Sub
I am creating a form, and I need help with my VBA Code. (Code is below) I can't get it to work. I am an amateur at this, so please, any help is appreciated. I think the problem lies in between the "Private Sub Document_Open() and the End Sub. How do I make the transition from opening the document to telling the document not to print placeholders in content control when the document is printed??
Private Sub Document_Open()
End Sub
Sub FilePrint()
Dim cc As ContentControl
Dim col As Long
With ActiveDocument
' hide placeholders
For Each cc In .ContentControls
If cc.ShowingPlaceholderText Then
col = cc.Range.Font.Color
cc.Range.Font.Color = wdColorWhite
End If
Next
Dialogs(wdDialogFilePrint).Show
For Each cc In .ContentControls
If cc.ShowingPlaceholderText Then
cc.Range.Font.Color = col
End Sub