The Holy Spirit inspired Solomon to write Ecclesiastes, but I see no evidence that He gave Solomon a knowledge of future events when he wrote this particular book. Rather, Solomon had thoroughly studied life on this earth, and the Holy Spirit moved Solomon to publish his conclusions.Included in his conclusions are references to God's future work of salvation which he undoubtedly gained from studying the Pentateuch and perhaps oral tradition handed down from Adam and Noah.