• 0

how to export


Question

i was wondering how can i create a new word document( office xp) using vb.net 2002 and export the data that is in a textbox to a bookmark!!! i've looked around but i can only find code for vb.net 2003 and office 2003

a little help would be appreciated

im

i've tried this

on top of the form

Imports Word = Microsoft.Office.Interop.Word( he doesn't recognize)

gives this--> Namespace or type 'Word' for the Imports 'Microsoft.Office.Interop.Word' cannot be found.

and associated to a button the following code

Dim export As word.Application--> Type 'word.Application' is not defined.

Dim newdoc As word.Document--> Type 'word.Document' is not defined.

Edited by paxa
Link to comment
https://www.neowin.net/forum/topic/315799-how-to-export/
Share on other sites

7 answers to this question

Recommended Posts

  • 0
  paxa said:
i was wondering how can i create a new word document( office xp) using vb.net 2002 and export the data that is in a textbox to a bookmark!!! i've looked around but i can only find code for vb.net 2003 and office 2003

a little help would be appreciated

im

i've tried this

on top of the form

Imports Word = Microsoft.Office.Interop.Word( he doesn't recognize)

gives this--> Namespace or type 'Word' for the Imports 'Microsoft.Office.Interop.Word' cannot be found.

and associated to a button the following code

Dim export As word.Application--> Type 'word.Application' is not defined.

Dim newdoc As word.Document--> Type 'word.Document' is not defined.

585863497[/snapback]

You need the Primary Interop Assembly for Office 2002(XP).

http://msdn.microsoft.com/vstudio/downloads/tools/

You need to reference the Word assembly in your project.

Link to comment
https://www.neowin.net/forum/topic/315799-how-to-export/#findComment-585863955
Share on other sites

  • 0

as i said before now i can open the document that i want, but the problem is that i can't export the contents of a text to a place in a document!! i' ve created the bookmarks but it doesn't export the contents

i've tried this

oDoc.Bookmark.item.range("teste").range.textTextBoxTextBoxremetente.Text

to export but i doesn't work, it opens the document but it doesn't do want i want

once again a little help would be appreciated

Link to comment
https://www.neowin.net/forum/topic/315799-how-to-export/#findComment-585878436
Share on other sites

  • 0

i used this code to try to export the data that i want to export

Dim oWord As Word.Application

Dim oDoc As Word.Document

Dim oRange As Word.Range

Dim selection As Word.Selection

Dim obook As Word.Bookmarks

oWord = CreateObject("Word.Application")

oWord.Visible = True

'oDoc = oWord.Documents.Add

oWord.Documents.Add("c:\tempus\teste2.dot

If oDoc.ActiveDocument.Bookmarks.Exists("teste") = True Then

oDoc.ActiveDocument.Bookmarks("teste").Select()

End If

oDoc.ActiveDocument.Bookmarks.Add(Name = "teste", oRange:=selection.Range)

oDoc.Bookmark.item.range("teste").range.textTextBoxTextBoxremetente.Text

click the button that the code is associated

the following error appears

An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.visualbasic.dll

Additional information: Object variable or With block variable not set.

any help would be appreciated

Link to comment
https://www.neowin.net/forum/topic/315799-how-to-export/#findComment-585878717
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • AnyDesk 9.5.7 by Razvan Serea AnyDesk is a fast remote desktop system and enables users to access their data, images, videos and applications from anywhere and at any time, and also to share it with others. AnyDesk is the first remote desktop software that doesn't require you to think about what you can do. CAD, video editing or simply working comfortably with an office suite for hours are just a few examples. AnyDesk is designed for modern multi-core CPUs. Most of AnyDesk's image processing is done con­currently. This way, AnyDesk can utilize up to 90% of modern CPUs. AnyDesk works across multiple platforms and operating systems: Windows, Linux, Free BSD, Mac OS, iOS and Android. Just five megabytes - downloaded in a glimpse, sent via email, or fired up from your USB drive, AnyDesk will turn any desktop into your desktop in se­conds. No administrative privileges or installation needed. AnyDesk 9.5.7 changelog: Fixed Bugs Fixed deadlock when updating chat server Fixed crashes caused by exceptions in internal communication layer Fixed crash when opening new monitor in Session in a new window Fixed crash on shutdown Fixed bug that allowed naming Permission Profiles identical to predefined Profiles Fixed bug that could cause licensed remote clients to show up as free Fixed visual bug that caused Set-Password button to show up when Unattended Access was disabled Fixed bug that lead to selecting the wrong initial resolution for webcams New Features Added command line option --record-screen to start a Screen Recording Other Changes Improved visual consistency in some list views Download: AnyDesk 9.5.7 | macOS ~14.0 MB (Free for private use, paid upgrade available) Links: AnyDesk Home Page | Other platforms | Release History | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • WUT?! Tell us you've never built desktop software without telling us you've never built desktop software... The chromium rendering engine is the content-rendering engine for "chromium-based browsers," but that does NOT mean there's a full-on UI underneath that is somehow bloating these products. The bloat is from the additional UI components that the browser vendor (Vivaldi) is adding atop the base package. Most chromium browsers customize the default skin/theme of the overall package so there's absolutely zero added overhead; it's really just a different CSS-based theme pack. Vivaldi, however, adds more than just a different skin; they add built-in extensions (that are managed by other built-in extensions), add other customization modules, and all kinds of other bloat -- and these add-ons are EXACTLY where the resource-hogging stems from. The mere fact it's a chromium-based browser has no impact on the matter. Lastly, power users literally DO notice resource-intensive applications -- they'll even be familiar with tools and widgets that expose those measurements the way only a power-user would! General consumers, however, would simply remark that their rig is sluggish and probably outdated and blindly upgrade to whatever the salespeople are hawking at the local computer store. General consumers wouldn't even upgrade their existing computer cuz they wouldn't know how to!
    • Nope, they just removed the game from sales.
    • Welcome to Neowin! Please enjoy your stay!
  • Recent Achievements

    • First Post
      Celilo earned a badge
      First Post
    • One Year In
      K.I.S.S. earned a badge
      One Year In
    • Week One Done
      solidox earned a badge
      Week One Done
    • Dedicated
      solidox earned a badge
      Dedicated
    • Week One Done
      Devesh Beri earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      442
    2. 2
      ATLien_0
      168
    3. 3
      +FloatingFatMan
      152
    4. 4
      Nick H.
      66
    5. 5
      macoman
      63
  • Tell a friend

    Love Neowin? Tell a friend!