In recent years, there has been an increasing recognition of the importance of the coordinated development of digitalization and greenization. However, the existing research lacks a systematic framework for understanding the relationship between different dimensions of digital transformation and various strategies of green innovation. Furthermore, the role of different types of slack resources in this relationship has been largely overlooked. This paper aims to address these gaps by examining the impact of digital transformation on corporate greenization and the moderating role of organizational slack from a heterogeneity perspective. To achieve this, we differentiate digital transformation into two dimensions: breadth and depth. Similarly, corporate greenization is divided into input and output. Additionally, we distinguish between absorbed and unabsorbed slack resources. We empirically test our research hypotheses using data from Chinese A-share listed companies from 2011 to 2020. Our findings reveal the following insights: 1) The breadth and depth of digital transformation positively influence corporate greenization outputs, while negatively affecting greenization inputs. 2) The depth of digital transformation has a stronger impact on both greenization input and output compared to its breadth. 3) Absorbed slack resources and unabsorbed slack resources not only act as negative moderators in the relationship between digital transformation and greenization inputs but also weaken the positive impact of digital transformation on greenization outputs. 4) Absorbed slack resources exhibit a stronger moderating effect than unabsorbed slack resources. This paper contributes to the literature by shedding light on the differential effects of different dimensions of digital transformation on various types of greenization, considering the role of slack resources. Moreover, it provides practical implications for effectively advancing digitalization and greenization in Chinese enterprises.