-
Question about running VBA macro automatically upon opening document
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
-
-
Thank you SO much ! It worked !
-
I know
-
Ok, Greg, now I have another question. My text in content control is not consistent. Some will show up as bold, others non bold. I am not sure why this is happening as I am making sure the text says non bold in the content control settings. Do you have any idea why this is happening?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules