How make text bold via Append Text to Word Application Scope?

Hi,

I want to have some words bold when I add them to word via Append Text. I would want the yellow text in my code below to come out as bold in the word document. Is that possible?

Bold text

Kind regards,
Anna

1 Like

There is no direct activity but we can do it with vb script after appending the text

Use INVOKE code activity and use this code

Sub MakeTextBold(customText As String)
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = customText
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.Font.Bold = wdToggle
End Sub

In the “Invoke VBA” activity properties:

  • Set the “DocumentPath” property to the path of your Word document where the macro is defined.
  • Set the “MacroName” property to “MakeTextBold” or the name of your VBA macro.
  • Under the “Parameters” property, create an In/Out argument named “customText” (the same name as the parameter in your VBA macro) and provide the text you want to make bold as a value or variable.

Hope this helps

Cheers @ahaegglund

1 Like

Sounds difficult :). I think I will just mark the headings with “----TEXT----”.
But thank you very much for your help. I will save this code and see if I can make it work when I do not have so much to do

//Anna

1 Like

I checked with existing activities and also with marketplace component
Couldn’t find any method
That’s why suggested this

@ahaegglund

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.