/ Forums / Advansys Formativ / Formativ Creator / Make some words bold before sending / Reply To: Make some words bold before sending

#5647
Support 3
Participant

You can also obtain an instance of the IHTMLDocument interface associated with the given window handle then update inner html.

See IHTMLDocument2 interface for available members: http://msdn.microsoft.com/en-us/library/aa752574%28VS.85%29.aspx

The code below access message body, set bold to some of the words.

  
  dim oList
  dim oDocument

  dim x
  dim text  
  dim innerHtml
  dim handle

  ' List of word to modify
  set oList = utilities.stringlist
  oList.add("Hello")
  oList.add("World")
  oList.add("Regards")


  set oDocument = nothing

  ' Get the message handle
  handle = Utilities.FindWindow("OFMailView", "")

  ' Get an instance of the IHTMLDocument interface
  if Utilities.IHTMLDocumentFromViewHandle(handle, oDocument) = 0 then
    innerHtml = oDocument.body.innerHtml

    for x = 0 to oList.Count - 1
      text  = oList.Strings(x)
      innerHtml = utilities.FastReplace(innerHtml, text, "<b>" & text & "</b>", false)
    next

    oDocument.body.innerHtml = innerHtml
  end if

  set oList = nothing
  set oDocument = nothing

Hope this helps.

Regards,
Advansys Support