Hi guys,
How is everything?
I hope you’ll be able to assist me with the following
I’m trying to write a code which will open for me an existing word file, create for me a new one, and make the background colour of this newly created file as black and its font colour as automatic.
So far I’ve accomplished the first and the second step with the following code;
Code
Sub TrialHere()
Dim wkb As Workbook
Dim WordApp As Object
Dim WordDoc As Object
Dim objWord
Dim objDoc
Set WordApp = CreateObject("word.Application")
Set WordDoc = WordApp.Documents.Open(Filename:="File Path", ReadOnly:=False)
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add
objWord.Visible = True
Set WordApp = Nothing
Set WordDoc = Nothing
End Sub
Display More
I’ve tried to execute the third step by the following code but it didn’t work though:
Code
ActiveDocument.Background.Fill.ForeColor.ObjectThemeColor = _
wdThemeColorText1
ActiveDocument.Background.Fill.ForeColor.TintAndShade = 0#
ActiveDocument.Background.Fill.Visible = msoTrue
ActiveDocument.Background.Fill.Solid
So, any help please?