‎17-12-2014 11:37 AM
Hello,
in our Website we want to add a new descriptor, but it's content needs to be generated by a Macro. Now the problem is that when we try to include images, the HTML output includes hard links to images (Such as <img src="c:\program files (x86)\MEGA\.."/>)
In a website descriptor we can use [Variable=StdFile File="...."/] to make the Website generator copy the relevant image and create a relative link (Such as <img src="../images/appl.gif"/>). This works fine but the Macro-generated images do not get converted. Is there a Macro equivalent of calling [Variable=StdFile File="..."/] in a Website generation context? We want to use this to replace the hard links and create a working website.
Solved! Go to Solution.
‎20-01-2015 11:43 AM - edited ‎20-01-2015 11:44 AM
Hello alros,
you can try this in your macro :
Sub Generate(oObject, oContext, sUserData, sResult)
Dim oRoot, oWebsite
Set oRoot = oObject.GetRoot
Set oWebsite = oContext.Website
sResult = "<h2><img src=" & Chr(34)
If oWebsite Is Nothing Then
sResult = sResult & oContext.StdFileCopy("appl.gif","","")
Else
sResult = sResult & oContext.StdPath(1,False) & oContext.StdFileCopy("appl.gif","","")
End If
sResult = sResult & Chr(34) & " alt=" & Chr(34) & "Softwares" & Chr(34) & " style=" & Chr(34) & "vertical-align:middle;" & Chr(34) & "/> Softwares</h2>"
End Sub