Let $G$ be a simple connected graph. The Wiener index of $G$ is the sum of all distances between vertices of $G$. Whereas, the edge Wiener index of $G$ is defined as the sum of distances between all pairs of edges of $G$ where the distance between the edges $f$ and $g$ in $E(G)$ is defined as the distance between the vertices $f$ and $g$ in the line graph of $G$. In this paper we will describe a new method for calculating the edge Wiener index. Then find this index for the triangular graphs. Also, we obtain an explicit formula for the Wiener index of the Cartesian product of two graphs using the group automorphisms of graphs.