VipulPathak
October 13th, 2001, 06:41 AM
Hi !!
How can i Set TAB in a Word Document using the Word.Application Object ?
Consider the following Code Snippet -
Dim appWord as Word.Application
'
on error resume next
set appWord = GetObject("Word.Application")
If appWord is nothing then
set appWord = CreateObject("Word.Application")
End If
'
appWord.Visible = false
prgIndicator.Value = prgIndicator.Value + 10
appWord.Documents.Open APP_PackageRunDir & "\Bill.Printout.rtf"
appWord.ActiveDocument.SaveAs APP_PackageRunDir & "\Bill.Printout.doc", wdFormatDocument
'
If MInv_Type = InvType.InvBAKERY then
appWord.Selection.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.AddPicture APP_PackageRunDir & "\BillHeader.jpg", , , 0, , 705, 151
appWord.ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Shapes.AddTextEffect msoTextEffect1, Space(23) & BillType & " LH* : Total Packages for LH/ORO/Checkkers , CBB* : Rate for CBB/LH/Checkkers.", "Times new Roman", 12, msoCTrue, msoCTrue, 4, 570
else
appWord.Selection.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.AddPicture APP_PackageRunDir & "\BillHeader.jpg", , , 0, , 540, 120
appWord.ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Shapes.AddTextEffect msoTextEffect1, " [ Dairy Division ] .", "Times new Roman", 12, msoCTrue, msoCTrue, 4, 400
End If
'
'
'
' Desired some Code here ..........
'
' The Code Should be able to Insert 5 TAB Positions each 1.25 Inch wide.
'
' HELP PLEASE, HOW ????
' to set TAB: appWord.ActiveDocument. ???
'
' --or-- Some thing else ?
'
Thanks !!
PS: I work with Win32 API Programming, and not with MFC.
-Vipul Pathak.
Indore, (MP) INDIA.
ICQ# 102045224
If this Helps: Please Rate .... :-)
How can i Set TAB in a Word Document using the Word.Application Object ?
Consider the following Code Snippet -
Dim appWord as Word.Application
'
on error resume next
set appWord = GetObject("Word.Application")
If appWord is nothing then
set appWord = CreateObject("Word.Application")
End If
'
appWord.Visible = false
prgIndicator.Value = prgIndicator.Value + 10
appWord.Documents.Open APP_PackageRunDir & "\Bill.Printout.rtf"
appWord.ActiveDocument.SaveAs APP_PackageRunDir & "\Bill.Printout.doc", wdFormatDocument
'
If MInv_Type = InvType.InvBAKERY then
appWord.Selection.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.AddPicture APP_PackageRunDir & "\BillHeader.jpg", , , 0, , 705, 151
appWord.ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Shapes.AddTextEffect msoTextEffect1, Space(23) & BillType & " LH* : Total Packages for LH/ORO/Checkkers , CBB* : Rate for CBB/LH/Checkkers.", "Times new Roman", 12, msoCTrue, msoCTrue, 4, 570
else
appWord.Selection.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.AddPicture APP_PackageRunDir & "\BillHeader.jpg", , , 0, , 540, 120
appWord.ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Shapes.AddTextEffect msoTextEffect1, " [ Dairy Division ] .", "Times new Roman", 12, msoCTrue, msoCTrue, 4, 400
End If
'
'
'
' Desired some Code here ..........
'
' The Code Should be able to Insert 5 TAB Positions each 1.25 Inch wide.
'
' HELP PLEASE, HOW ????
' to set TAB: appWord.ActiveDocument. ???
'
' --or-- Some thing else ?
'
Thanks !!
PS: I work with Win32 API Programming, and not with MFC.
-Vipul Pathak.
Indore, (MP) INDIA.
ICQ# 102045224
If this Helps: Please Rate .... :-)