• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Formatting Word ducuments using Jacob

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am working on a project to generate Word documents from Java code and am using the Jacob bridge. I'm able to do most things I require but am having real trouble with applying a formatting style to a a section of text.

I generally work out the calls to make by creating a macro and converting the code it produces into Jacob calls. Setting the style to "Heading 1" will produce the macro code:

Selection.Style = ActiveDocument.Styles("Heading 1")

I have converted this as follows:



but this produces the following exception:

com.jacob.com.ComFailException: Can't map name to dispid: Heading 1

Any ideas what's going wrong?

Thanks for any assistance.

Jon
 
You showed up just in time for the waffles! And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic