Click here to Skip to main content
15,905,071 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionAdding data in datagrid thru textboxes Pin
lahsiv21-Aug-08 7:22
lahsiv21-Aug-08 7:22 
AnswerRe: Adding data in datagrid thru textboxes Pin
Mycroft Holmes21-Aug-08 12:25
professionalMycroft Holmes21-Aug-08 12:25 
GeneralRe: Adding data in datagrid thru textboxes Pin
lahsiv21-Aug-08 18:41
lahsiv21-Aug-08 18:41 
QuestionSave As Button Pin
Learning21-Aug-08 6:15
Learning21-Aug-08 6:15 
AnswerRe: Save As Button Pin
jzonthemtn21-Aug-08 6:37
jzonthemtn21-Aug-08 6:37 
GeneralRe: Save As Button Pin
Learning21-Aug-08 7:19
Learning21-Aug-08 7:19 
GeneralRe: Save As Button Pin
Steven J Jowett21-Aug-08 7:26
Steven J Jowett21-Aug-08 7:26 
Question.NET makes it impossible to print from Excel 2003??? Pin
mSh198521-Aug-08 4:45
mSh198521-Aug-08 4:45 
Hi,
I have an vb.net application that opens a word document, fills in some data, prints it out (on a printer that is not set as standard printer)
Because .NET sets the other printer as standard, i have another line that puts the original printer back as standard printer
When this program was used, it is impossible to print something from excel 2003... Something in my program does something to excel apparently Confused | :confused:

This is the code i use (short version)

Imports wrd = Microsoft.Office.Interop
Module Module1
    Sub Main()
        Dim moapp As wrd.Word.Application
        Dim odoc As wrd.Word.Document

        moapp = New wrd.Word.ApplicationClass().Application
        moapp.Visible = False

        odoc = moapp.Documents.Add("C:\Documents and Settings\9312323\Desktop\excelbug.doc")

        moapp.ActivePrinter = "\\N318416\PRINT068 NRG SP 4100N"
        'With moapp.ActiveDocument.PageSetup
        '    .FirstPageTray = 258
        '    .OtherPagesTray = 258
        'End With
        'moapp.Application.PrintOut(FileName:="", Range:=wrd.Word.WdPrintOutRange.wdPrintAllDocument, Item:= _
        '     wrd.Word.WdPrintOutItem.wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wrd.Word.WdPrintOutPages.wdPrintAllPages, _
        '     ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
        '     False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
        '     PrintZoomPaperHeight:=0)

        moapp.ActivePrinter = "\\N318416\PRINT019 NRG P7527n"
        odoc.Close(False)
        moapp.Quit()
    End Sub

End Module


Has anyone got an idea how to work around this problem? My application works just fine.. but Excel 2003 can't print anymore

if someone won't believe this, just copy the code in a new project, add reference to microsoft word 11.0 object library, and run it , then try to print something from excel (without changing printer first)

grtz

edit: if you should try the code, i would recommend on changing the printernames Poke tongue | ;-P
AnswerRe: .NET makes it impossible to print from Excel 2003??? Pin
Tim Carmichael21-Aug-08 6:09
Tim Carmichael21-Aug-08 6:09 
GeneralRe: .NET makes it impossible to print from Excel 2003??? Pin
mSh198521-Aug-08 6:34
mSh198521-Aug-08 6:34 
QuestionHow to hide the current cell selection outline box in the datagridview? [modified] Pin
Jon_Boy21-Aug-08 3:26
Jon_Boy21-Aug-08 3:26 
AnswerRe: How to hide the current cell selection outline box in the datagridview? Pin
Jon_Boy21-Aug-08 4:50
Jon_Boy21-Aug-08 4:50 
GeneralRe: How to hide the current cell selection outline box in the datagridview? Pin
ChandraRam22-Aug-08 1:40
ChandraRam22-Aug-08 1:40 
GeneralRe: How to hide the current cell selection outline box in the datagridview? Pin
Jon_Boy22-Aug-08 4:08
Jon_Boy22-Aug-08 4:08 
QuestionScript (VBS) (WMI) To query Resultant Set of Policy (RSoP) and get security settings Pin
rocker198721-Aug-08 1:35
rocker198721-Aug-08 1:35 
QuestionConverting C# code to VB.net Pin
dix21-Aug-08 0:55
dix21-Aug-08 0:55 
AnswerRe: Converting C# code to VB.net PinPopular
Christian Graus21-Aug-08 1:16
protectorChristian Graus21-Aug-08 1:16 
GeneralRe: Converting C# code to VB.net Pin
Paul Conrad21-Aug-08 18:43
professionalPaul Conrad21-Aug-08 18:43 
AnswerCP IGNORE Pin
leckey21-Aug-08 3:56
leckey21-Aug-08 3:56 
QuestionBig Endian format and IP Address Pin
ddspliting20-Aug-08 23:45
ddspliting20-Aug-08 23:45 
AnswerRe: Big Endian format and IP Address Pin
Christian Graus21-Aug-08 0:10
protectorChristian Graus21-Aug-08 0:10 
GeneralRe: Big Endian format and IP Address Pin
ddspliting21-Aug-08 0:57
ddspliting21-Aug-08 0:57 
GeneralRe: Big Endian format and IP Address Pin
Christian Graus21-Aug-08 1:26
protectorChristian Graus21-Aug-08 1:26 
AnswerRe: Big Endian format and IP Address Pin
Alan N21-Aug-08 1:59
Alan N21-Aug-08 1:59 
Questionsql statement ignored by ozeki sms server. Pin
peanutong20-Aug-08 23:34
peanutong20-Aug-08 23:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.