English 中文(简体)
内容管理系统文件到网页输入箱的复印件
原标题:Copy from MS Word document to a web page input box
  • 时间:2010-09-28 08:52:44
  •  标签:
  • vba
  • ms-word

In an already open word document select all text
copy selected text to clipboard
check default browser open at correct web address
if not open default browser at web address "http://thisaddress.com"
give focus to browser paste clipboard text into input box called "input1"

或以其他方式将MSword文件内容输入网页投入?

目前,工作流程涉及在网站上进行秘书伐木,然后填写网络表格,转而使用公开的MS Word文件,选择所有文件,复制WP文件,然后回到网上表格,并贴上投入箱,然后点击提交。 理想的情况是,在管理词中有一个纽州,向正确的网页开放浏览器,然后将文件复制成正确的投入箱(事实上这将是唯一的文本领域)。

语言管理协会守则是:

Option Explicit

Enum W32_Window_State
    Show_Normal = 1
    Show_Minimized = 2
    Show_Maximized = 3
    Show_Min_No_Active = 7
    Show_Default = 10
End Enum

Private Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" (ByVal hWnd As Long, _
    ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long

Function OpenURL(URL As String, WindowState As W32_Window_State) As Boolean

  Opens passed URL with default application, or Error Code (<32) upon error

    Dim lngHWnd As Long
    Dim lngReturn As Long

    lngReturn = ShellExecute(lngHWnd, "open", URL, vbNullString, _
        vbNullString, WindowState)

    OpenURL = (lngReturn > 32)
End Function

Sub TestMacro()
  Application.ActiveDocument.Select
  Selection.Copy
  OpenURL "http://localhost:8500/index.cfm?wordContent=" & Selection, W32_Window_State.Show_Maximized
End Sub

以及冷聚处理形式

<html>
<head>
</head>

<body>
<form id="form1">
    <Textarea ID="txtArea" rows=6><cfoutput>#url.wordContent#</cfoutput></textarea>
</form>

</body>
</html>

如果已经打开了新浏览器窗户,那么我们也要努力。

最佳回答

如果你可以修改网络应用,你可以做如下工作:

  1. MS-Word: Copy content to clipboard.
  2. MS-Word: Open Url as "http://thisaddress.com/SomePage?pasteClipboard=true"
  3. SomePage: if query-string param pasteClipboard == true, then add a javascript function to get the clipboard data into your form field.

<>Update:

在你的宏观工作中,你简单地叫<代码>。 http://www.experts-change.com/Programing/Languages/Visual_Basic/Q_23225744.html

我利用前几条链接的守则,做了以下试验:

Sub TestMacro()
  Application.ActiveDocument.Select
  Selection.Copy
  OpenURL  "http://thisaddress.com/SomePage?pasteClipboard=true", W32_Window_State.Show_Maximized
End Sub

我希望这是有益的。

<><>上>

Just use W32_Window_State.Show_Default 这里是全面的宏观:

Option Explicit

Enum W32_Window_State
    Show_Normal = 1
    Show_Minimized = 2
    Show_Maximized = 3
    Show_Min_No_Active = 7
    Show_Default = 10
End Enum

Private Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" (ByVal hWnd As Long, _
    ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long

Function OpenURL(URL As String, WindowState As W32_Window_State) As Boolean

  Opens passed URL with default application, or Error Code (<32) upon error

    Dim lngHWnd As Long
    Dim lngReturn As Long

    lngReturn = ShellExecute(lngHWnd, "open", URL, vbNullString, _
        vbNullString, WindowState)

    OpenURL = (lngReturn > 32)
End Function

Sub TestMacro()
  Application.ActiveDocument.Select
  Selection.Copy
  OpenURL "http://thisaddress.com/SomePage?pasteClipboard=true", W32_Window_State.Show_Default
End Sub
问题回答

另一种选择是利用控制权从内部对因特网探索者进行控制。

rel=“nofollow”>Here就是一个例子。

请注意,这只能与IEE合作(除非有批发号......)。





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签