Hi
I'm working with word 2003 in vb6
In my project code if i type Word.Document it will be like that WORD.Document
Also when i open my project it will be like that Word.Document and when i highlighted it will turn to capital like that WORD.Document and anything relating to the word
Also objDoc.SAVE if i change it to this objDoc.Save it will be like that objDoc.SAVE after i finishe
If i run my project and run it again in the backgroun in task manager processes there is 2 WINWORD.EXE
Code:Option Explicit Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const ES_UPPERCASE = &H8& Private Const GWL_STYLE = (-16) Public appWord As WORD.Application 'Public myRange As WORD.Range 'Public objRange As WORD.Range Private Declare Function SHCreateDirectoryEx Lib "shell32" Alias "SHCreateDirectoryExA" _ (ByVal hwnd As Long, ByVal pszPath As String, ByVal psa As Any) As Long Public objDoc As WORD.Document Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long) Private Sub WORD_Click() On Error Resume Next Dim appWord As Object Set appWord = CreateObject("Word.Application") appWord.Visible = False appWord.Documents.Add objDoc.SAVE 'Insert Document Footer With objDoc.ActiveWindow.View .Type = wdPrintView .SeekView = wdSeekPrimaryFooter End With appWord.Selection.HeaderFooter.PageNumbers.Add _ PageNumberAlignment:=wdAlignPageNumberCenter 'If you want to remove the reference to Word Library in your project, 'you'll need to define all constants used.. appWord.ActiveDocument.SaveAs FileName:=TempFileName, FileFormat:= _ wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _ True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _ False, SaveNativePictureFormat:=False, SaveFormsData:=False, _ SaveAsAOCELetter:=False appWord.Documents.Close appWord.Application.Quit Set appWord = Nothing End Sub




Reply With Quote