Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. MS Word Automation [modified] correct and/or add styles to an existing document using template ????

MS Word Automation [modified] correct and/or add styles to an existing document using template ????

Scheduled Pinned Locked Moved Visual Basic
wpfwcftestingtoolsjson
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amr M K
    wrote on last edited by
    #1

    Dear All I ma using late binding to Done word parsing I have word document i want to change the style of paragraphs using template docuemtn For exmaple Par(1) style ="This style 1" Par(2) style ="This style 2" My code : Dim o_nullobject As Object = System.Reflection.Missing.Value Dim o_filePath As Object = FilePath''file have paragraphs Dim oTemplate As Object = TemplePath Dim oFalse As Object = False Dim oTrue As Object = True wordApp = CreateObject("Word.Application") doc = CreateObject("Word.Document") alse, o_nullobject, o_nullobject) doc = wordApp.Documents.Open(o_filePath, o_nullobject, oFalse, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, oFalse, o_nullobject, o_nullobject, o_nullobject, o_nullobject) doc.Activate() ParseWordStyle() Private Sub ParseWordStyle() Try Dim i As Int64 '' Dim style As String Dim parsText As String ''Dim p As Object = doc.Styles[""] For i = 1 To doc.Paragraphs.Count doc.Paragraphs(i).Range.Style ="some style"....... ''''''''''''''''''''''''''''''' my problem How to set paragaphs text of styles from template

    Yes. CreatiVity withOuT limiTs

    modified on Wednesday, March 18, 2009 6:02 AM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups