ASP, Word, Client Side vbScript 
Author Message
 ASP, Word, Client Side vbScript

I am opening a new word document from an ASP Page using Client Side VBScript.
Here is the code. Everything works fine except the first line...

    .ParagraphFormat.Alignment = wdAlignParagraphCenter

Anyone know why???

<script LANGUAGE="VBScript">
sub AcqPlan_onclick()
 Dim objWord
 Set objWord = CreateObject("Word.Application")
 Dim MyDoc
 Set MyDoc = objWord.documents.Add
 objWord.visible = True
  with objWord.Selection
        .ParagraphFormat.Alignment = wdAlignParagraphCenter
        .TypeParagraph
        .Font.Name = "Arial"
        .Font.Size = 16
        .TypeText "Acquistion Plan"
        .TypeParagraph
        .TypeParagraph
        .ParagraphFormat.Alignment = wdAlignParagraphLeft
        .Font.Name = "Times New Roman"
        .Font.Bold = True
        .Font.Size = 12
        .TypeText "Project Name: "
        .Font.Bold = False
        .TypeText  "<%=cProjName%>"
 end with
end sub
</script>

Thank you

Howard Katz



Mon, 06 Oct 2003 04:20:12 GMT  
 ASP, Word, Client Side vbScript
I posted this before but most of my posting was omitted. I'll try again.

I am opening a new word document from an ASP Page using Client Side vbScript.
Here is the code. Everything works fine except the lines that start

           .ParagraphFormat.Alignment = wdAlignParagraphCenter

This is supposed to put the text centered.  The font and size are OK.
the .TypeParagraph puts a hard return in. The font and size changes are OK. The
line which starts

           .TypeText  "<%=cProjName%>" works fine, getting the value of cProjName.

 Dim objWord
 Set objWord = CreateObject("Word.Application")
 Dim MyDoc
 Set MyDoc = objWord.documents.Add
 objWord.visible = True
 with objWord.Selection
        .ParagraphFormat.Alignment = wdAlignParagraphCenter
        .TypeParagraph
        .Font.Name = "Arial"
        .Font.Size = 16
        .TypeText "Acquistion Plan"
        .TypeParagraph
        .TypeParagraph
        .ParagraphFormat.Alignment = wdAlignParagraphLeft
        .Font.Name = "Times New Roman"
        .Font.Bold = True
        .Font.Size = 12
        .TypeText "Project Name: "
        .Font.Bold = False
        .TypeText  "<%=cProjName%>"
        .TypeParagraph
        .TypeParagraph
end with

Anyone have any ideas.

Thank you

Howard Katz



Mon, 06 Oct 2003 21:44:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Strange behavior of VBscript/WMI into ASP (compared to VBscript/WMI into client-side application)

2. Client-side VBScript and Server-side VBScript?

3. Client side VBScript for form validation in an asp page

4. pass the string from ASP vbscript to client side script

5. Open Microsoft Word Client-Side with VBScript

6. ASP referring to server side variables in client side script

7. pass server side vbscript to client side javascript

8. Calling client-side javascript function from server-side vbscript

9. dumb question - fundamentals of client-side vs server-side vbscript

10. getting server side vbscript array to client side jscript

11. ? Get rid of VBScript title in msgbox (client Side VBScript)

12. ASP.NET Web App: How To Load Client File - Process from Server Side - then Ask Client to Save Output File on Client Side?

 

 
Powered by phpBB® Forum Software