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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Help with creating a Word File using .net

Help with creating a Word File using .net

Scheduled Pinned Locked Moved Visual Basic
helpcsharpquestion
3 Posts 2 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.
  • G Offline
    G Offline
    gundamhamtaro
    wrote on last edited by
    #1

    i'm writing this code to be used on a PDA, what i want is to just create a Word document, write some things in and close it. But when i try opening it, an error appears saying that the file cant be opened. Dim fs As New FileStream("newfile.doc", FileMode.Create, FileAccess.Write, FileShare.None) Dim sm As New StreamWriter(fs) Dim i As Integer Dim j As Integer sm.WriteLine("test") sm.Close() what did i do wrong?

    A 1 Reply Last reply
    0
    • G gundamhamtaro

      i'm writing this code to be used on a PDA, what i want is to just create a Word document, write some things in and close it. But when i try opening it, an error appears saying that the file cant be opened. Dim fs As New FileStream("newfile.doc", FileMode.Create, FileAccess.Write, FileShare.None) Dim sm As New StreamWriter(fs) Dim i As Integer Dim j As Integer sm.WriteLine("test") sm.Close() what did i do wrong?

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      pocket word won't recognize a ".doc" (they are: .psw,.psw and ect...) the format of a pocket word document is actually "rich text format" so create your file as a .TXT or .RTF The pocket office apps have no exposed API or automation. Pocket Word also does not support headers, footers, footnotes, captions, indexes or comments

      G 1 Reply Last reply
      0
      • A Anonymous

        pocket word won't recognize a ".doc" (they are: .psw,.psw and ect...) the format of a pocket word document is actually "rich text format" so create your file as a .TXT or .RTF The pocket office apps have no exposed API or automation. Pocket Word also does not support headers, footers, footnotes, captions, indexes or comments

        G Offline
        G Offline
        gundamhamtaro
        wrote on last edited by
        #3

        i found the problem, i forgot to close the filestream object which i set permissions on. thanks for the reply anyway.

        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