|
|
|
เรื่องรูป ใน word ทำไงดีเนี่ย ทำแล้ว มันไม่ขึ้น ( มาแต่ข้อมูลเหมือนเดิม ) มีโค้ดตัวอย่างมั้ยคะ |
|
|
|
|
|
|
|
ลองทำดู ตามที่แนะนำมามันขึ้นเป็นตัวอักษรแปลกๆ
เข้าใจว่ามันไม่อ่านค่าเป็นรูปภาพจะทำไงดีคะ
|
|
|
|
|
Date :
5 มี.ค. 2548 21:11:23 |
By :
nongnoy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (AspWordAddPicture.asp)
<% Option Explicit %>
<html>
<head>
<title>ThaiCreate.Com ASP & Word.Application</title>
</head>
<body>
<%
Const wdColorDarkRed = &H80
Const wdAlignParagraphCenter = 1
Const wdAlignParagraphLeft = 0
Const wdParagraph = 4
Const wdHorizontalPositionMargin = 0
Const wdTableLeft = -999998
Const wdCollapseEnd = 0
Dim Wrd,WrdDoc,DocName
Dim MyRange1,MyRange2,MyRange3
Set Wrd = CreateObject("Word.Application")
DocName = "MyDoc/MyWord.doc"
Wrd.Application.Visible = False
Set WrdDoc = Wrd.Documents.Add()
Set MyRange1 = WrdDoc.Paragraphs.Add.Range
With MyRange1
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Name = "Verdana"
.Font.Size = "30"
.Font.Bold = True
.InsertBefore(vbCrLf&vbCrLf&"www.ThaiCreate.Com"&vbCrLf&"Version 2009")
End With
MyRange1.InlineShapes.AddPicture Server.MapPath("thaicreate-2009.gif")
'WrdDoc.InlineShapes.AddPicture Server.MapPath("thaicreate-2009.gif")
'WrdDoc.Shapes.AddPicture Server.MapPath("thaicreate-2009.gif"),0,0,MyRange1
'WrdDoc.Shapes.AddPicture Server.MapPath("thaicreate-2009.gif"),40,6,Wrd.Selection.Range
Set MyRange2 = WrdDoc.Paragraphs.Add.Range
With MyRange2
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Name = "Verdana"
.Font.Size = "15"
.Font.Bold = True
.InsertBefore(vbCrLf&vbCrLf&"PHP,ASP and ASP.NET Tutorial")
End With
MyRange2.InlineShapes.AddPicture Server.MapPath("doc.gif")
Set MyRange3 = WrdDoc.Paragraphs.Add.Range
With MyRange3
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Name = "Verdana"
.Font.Size = "10"
.Font.Bold = True
.Font.Color = wdColorDarkRed
.Underline = True
.InsertBefore(vbCrLf&vbCrLf&vbCrLf&vbCrLf&"All Rights Reserved")
End With
WrdDoc.SaveAs(Server.MapPath(DocName))
Wrd.Application.Quit
Set Wrd = Nothing
%>
Word Created <a href="<%=DocName%>">Click here</a> to Download.
</body>
</html>
|
|
|
|
|
Date :
2009-04-25 09:40:48 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|